net: Use proxy server 127.0.0.1 if -proxy is specified without arguments (instead of continuing without proxy server) #20001

pull practicalswift wants to merge 2 commits into bitcoin:master from practicalswift:use-localhost-instead-of-silently-skipping-proxy changing 5 files +14 −10
  1. practicalswift commented at 11:47 AM on September 23, 2020: contributor

    Use proxy server 127.0.0.1 if -proxy is specified without arguments (instead of continuing without proxy server).

    Continuing without a proxy server when the end-user has specified -proxy may result in accidental loss of privacy. (The end-user might think he/she is using a proxy when he/she is not.)

    Before this patch:

    $ src/bitcoind -proxy
    …
    2020-09-23T00:24:33Z InitParameterInteraction: parameter interaction: -proxy set -> setting -listen=0
    2020-09-23T00:24:33Z InitParameterInteraction: parameter interaction: -proxy set -> setting -upnp=0
    2020-09-23T00:24:33Z InitParameterInteraction: parameter interaction: -proxy set -> setting -discover=0
    2020-09-23T00:24:33Z InitParameterInteraction: parameter interaction: -listen=0 -> setting -listenonion=0
    …
    2020-09-23T00:24:33Z init message: Starting network threads...
    

    bitcoind is now running without a proxy server (GetProxy(…, …) == false, HaveNameProxy() == false, etc.).

    Note that the "-proxy set" log messages above which the end-user might interpret as "good, my traffic is now routed via the proxy".

    After this patch:

    $ src/bitcoind -proxy
    …
    2020-09-23T00:24:33Z InitParameterInteraction: parameter interaction: -proxy set -> setting -listen=0
    2020-09-23T00:24:33Z InitParameterInteraction: parameter interaction: -proxy set -> setting -upnp=0
    2020-09-23T00:24:33Z InitParameterInteraction: parameter interaction: -proxy set -> setting -discover=0
    2020-09-23T00:24:33Z InitParameterInteraction: parameter interaction: -proxy set without argument -> setting -proxy=127.0.0.1
    2020-09-23T00:24:33Z InitParameterInteraction: parameter interaction: -listen=0 -> setting -listenonion=0
    …
    2020-09-23T00:24:33Z init message: Starting network threads...
    

    bitcoind is now running with a proxy server (GetProxy(…, …) == true, HaveNameProxy() == true, etc.).

  2. net: Introduce DEFAULT_PROXY_HOST and DEFAULT_PROXY_PORT 5c521d210f
  3. net: Use default proxy server (127.0.0.1) if -proxy is specified without arguments (instead of continuing without proxy server) 6bf8c9315c
  4. laanwj added the label P2P on Sep 23, 2020
  5. jonatack commented at 11:58 AM on September 23, 2020: member

    Interesting, TIL! Will look into this.

  6. laanwj commented at 11:58 AM on September 23, 2020: member

    Concept Meh. Good catch, but I think this should be an error. There is no such thing as a "default proxy server".

  7. practicalswift commented at 12:11 PM on September 23, 2020: contributor

    Concept Meh. Good catch, but I think this should be an error.

    Yes, I thought about making it an error as an alternative. Perhaps that is the way to go. I don't have any strong opinion.

    I'm happy as long as we fix this privacy gotcha :)

    There is no such thing as a "default proxy server".

    Technically you're right of course, but I'd assume that >95% of our users use -proxy=127.0.0.1 (which is equivalent to -proxy=127.0.0.1:9050).

    FWIW, we already have a default proxy port (9050).

  8. practicalswift renamed this:
    net: Use default proxy server (127.0.0.1:9050) if -proxy is specified without arguments (instead of continuing without proxy server)
    net: Use proxy server 127.0.0.1:9050 if -proxy is specified without arguments (instead of continuing without proxy server)
    on Sep 23, 2020
  9. practicalswift renamed this:
    net: Use proxy server 127.0.0.1:9050 if -proxy is specified without arguments (instead of continuing without proxy server)
    net: Use proxy server 127.0.0.1 if -proxy is specified without arguments (instead of continuing without proxy server)
    on Sep 23, 2020
  10. laanwj commented at 12:31 PM on September 23, 2020: member

    Yes, I thought about making it an error as an alternative. Perhaps that is the way to go. I don't have any strong opinion.

    I personally like being really explicit about errors, and avoid ambiguity, especially where privacy is potentially concerned.

  11. practicalswift commented at 12:32 PM on September 23, 2020: contributor

    @laanwj I think you have a good point. Explicit is better than implicit. Closing this PR. Will fix it by printing an error message instead :)

  12. practicalswift closed this on Sep 23, 2020

  13. fanquake locked this on Sep 23, 2020
  14. practicalswift deleted the branch on Apr 10, 2021
Labels

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-16 15:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me