Repository navigation
Add a SOCKS5 proxy option to the Electrum client - #199
Open
zebra-nerd wants to merge 4 commits into
Open
zebra-nerd wants to merge 4 commits into
zebra-nerd wants to merge 4 commits into
Conversation
Contributor
|
thanks @zebra-nerd lgtm with the above things removed |
Author
|
@LeoComandini thanks! Removed all four in f62f205 and updated the description to match. Ready for another look. |
The Electrum client could not be told to use a SOCKS5 proxy, so an application sending its wallet traffic through Tor had to wrap the whole process or put a relay in front of the server. electrum-client supports SOCKS5 and its `proxy` feature is already enabled here; the builder never passed a proxy on. - Add `ElectrumClientBuilder::socks5()`, taking the proxy as `host:port`. - The server host goes to the proxy as a domain name and is resolved there, so `.onion` urls work and no local DNS query is made. A unit test pins this against a local listener.
Expose the SOCKS5 proxy option of the Electrum client builder, so the foreign languages can connect through a proxy such as Tor. - Add the optional `socks5` field to the `ElectrumClientBuilder` record. - Add a Python example that runs offline against a local listener and checks the proxy is handed the server host name.
- Add a "SOCKS5 proxy" section to the Electrum client page. - List the new Python example.
The clients page describes the clients at a high level, and the doc comments of the Rust builder and of the bindings already describe the SOCKS5 option, so a dedicated section, example and test only add maintenance. - Remove the "SOCKS5 proxy" section of the Electrum client page and the link to its example. - Remove the Python example and its entry in the bindings tests. - Remove the unit test with a local SOCKS5 listener: the option maps directly to `electrum_client::Socks5Config`.
zebra-nerd
force-pushed
the
electrum-socks5
branch
from
December 5, 2026 01:28
f62f205 to
0e78d50
Compare
Author
|
Rebased on master to resolve the conflict (the |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Electrum client cannot be told to use a SOCKS5 proxy, so an application that sends its wallet traffic through Tor has to wrap the whole process (torsocks) or put a relay in front of the server.
electrum-clientalready supports SOCKS5 and itsproxyfeature is already enabled inlwk_wollet; the builder just never passes a proxy on.This adds
ElectrumClientBuilder::socks5()inlwk_wolletand the matching optionalsocks5field on the bindings'ElectrumClientBuilderrecord:host:port, aselectrum_client::Socks5Config::newtakes it..onionurls work and no DNS query for the server is made locally.Not in this PR:
socksfeature and a cfg for wasm, where a proxy cannot be set: sent separately as Add a proxy option to the Esplora and Waterfalls clients #200.Socks5Config::with_credentials, which Tor uses for stream isolation). The builder derivesDebug, so that would need a redacting impl first.TokenProvider::Blockstream: the OAuth2 token is still fetched over a direct HTTPS connection. This is stated in the doc comment ofsocks5().lwk_cliandlwk_wasm(the Electrum client is not built for wasm).This supersedes #60, which added the option to
ElectrumOptions, deprecated since.Checked locally with the pinned toolchain (1.91.0):
cargo fmt --check,cargo clippy -p lwk_wollet -p lwk_bindings --all-targets -- -D warnings, andcargo test --libfor both crates.