[Feature Request] Enable Socks5 proxy support at Transport level #57
Description
We had an usecase in BDK to have core-rpc client talk through a Tor proxy, like the electrum client, via a proxy configuration.
Potential use case: Mobile devices trying to connect to an Umbrel running at home for personal wallet usage via Tor.
Intention is to get RPC calls through Tor via cookie authentication through a Socks5 transport.
When I tried implementing it I ended up recreating the same SimpleHttpTransport
for Socks5 in this PR in BDK
bitcoindevkit/bdk#493
The resting Transport
looks like this.
https://github.com/bitcoindevkit/bdk/blob/b99f1cf6309c3daa6b7d432ecd77bbc69862af44/src/blockchain/rpc_proxy.rs
But its essentially duplicating code from low level, for an high level application.
Opening this issue to start discussing on the best approach to integrate it in jsonrpc
level and then in bitcoincore-rpc
.
My suggestion would be to add another module name simple_socks5
and export that back to bitcoincore-rpc
. Use that specific transport, if proxy options are set in client config. (Also maybe via a feature flag?)
I am open to work on the PR for this crate and for bitcoincore-rpc
, if we can decide on the approach.