public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
* [bitcoin-dev] bitcoind -proxy=host:port doesn't work for unroutable network
@ 2022-07-23  5:08 Anton Shevchenko
  2022-07-23 13:00 ` Anton Shevchenko
  0 siblings, 1 reply; 2+ messages in thread
From: Anton Shevchenko @ 2022-07-23  5:08 UTC (permalink / raw)
  To: Bitcoin Devs

Hello,

Got unexpected behavior when trying to run bitcoind with -proxy setting.
-proxy is used to connect to SOCKS5 proxy which is able to access some internal network.
bitcoind is started with -noconnect option and network activity is absent (as it should be).

Then I command bitcoin-cli to connect to node with address 10.x.y.z with the command
bitcoin-cli addnode 10.x.y.z add

Expected behavior is for bitcoind to initiate connection through proxy.
Actual behavior is bitcoind trying to connect without using proxy.

In the code:
CConnman::ConnectNode calls GetProxy and GetProxy returns false because CNetAddr::GetNetwork returns NET_UNROUTABLE.

My take is this is unexpected behavior at minimum and should be documented.
Better way is to introduce another option just for the unroutable addresses:
- connect locally (for compatibility reasons, default);
- connect thru proxy;
- don't connect to unroutable addresses.


--  Anton Shevchenko


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [bitcoin-dev] bitcoind -proxy=host:port doesn't work for unroutable network
  2022-07-23  5:08 [bitcoin-dev] bitcoind -proxy=host:port doesn't work for unroutable network Anton Shevchenko
@ 2022-07-23 13:00 ` Anton Shevchenko
  0 siblings, 0 replies; 2+ messages in thread
From: Anton Shevchenko @ 2022-07-23 13:00 UTC (permalink / raw)
  To: Bitcoin Devs

Sorry to post here. Now I realize this is an implementation issue.
Raised an issue at github - https://github.com/bitcoin/bitcoin/issues/25684

--  Anton Shevchenko

On Fri, Jul 22, 2022, at 10:08 PM, Anton Shevchenko via bitcoin-dev wrote:
> Hello,
>
> Got unexpected behavior when trying to run bitcoind with -proxy setting.
> -proxy is used to connect to SOCKS5 proxy which is able to access some 
> internal network.
> bitcoind is started with -noconnect option and network activity is 
> absent (as it should be).
>
> Then I command bitcoin-cli to connect to node with address 10.x.y.z 
> with the command
> bitcoin-cli addnode 10.x.y.z add
>
> Expected behavior is for bitcoind to initiate connection through proxy.
> Actual behavior is bitcoind trying to connect without using proxy.
>
> In the code:
> CConnman::ConnectNode calls GetProxy and GetProxy returns false because 
> CNetAddr::GetNetwork returns NET_UNROUTABLE.
>
> My take is this is unexpected behavior at minimum and should be documented.
> Better way is to introduce another option just for the unroutable addresses:
> - connect locally (for compatibility reasons, default);
> - connect thru proxy;
> - don't connect to unroutable addresses.
>
>
> --  Anton Shevchenko
> _______________________________________________
> bitcoin-dev mailing list
> bitcoin-dev@lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-07-23 13:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-23  5:08 [bitcoin-dev] bitcoind -proxy=host:port doesn't work for unroutable network Anton Shevchenko
2022-07-23 13:00 ` Anton Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox