Several proxy improvements #1141

pull sipa wants to merge 5 commits into bitcoin:master from sipa:proxystuff changing 6 files +351 −100
  1. sipa commented at 11:57 pm on April 22, 2012: member
    • SOCKS5 support.
    • Support connecting by passing hostnames to SOCKS5 proxy.
    • Retrofit -connect, -addnode and -dnsseed to use this mechanism is -proxydns is specified.
  2. in src/init.cpp: in f4fe12f74b outdated
    177@@ -178,8 +178,10 @@ bool AppInit2(int argc, char* argv[])
    178             "  -dbcache=<n>     \t\t  " + _("Set database cache size in megabytes (default: 25)") + "\n" +
    179             "  -dblogsize=<n>   \t\t  " + _("Set database disk log size in megabytes (default: 100)") + "\n" +
    180             "  -timeout=<n>     \t  "   + _("Specify connection timeout (in milliseconds)") + "\n" +
    181-            "  -proxy=<ip:port> \t  "   + _("Connect through socks4 proxy") + "\n" +
    182+            "  -proxy=<ip:port> \t  "   + _("Connect through socks proxy") + "\n" +
    183+            "  -socks=<n>       \t  "   + _("Select the version of socks proxy to use (4 or 5, 5 is default)") + "\n" +
    184             "  -dns             \t  "   + _("Allow DNS lookups for addnode and connect") + "\n" +
    185+            "  -proxydns        \t  "   + _("Pass DNS requests to (SOCKS5) proxy") + "\n" +
    


    laanwj commented at 3:51 pm on April 23, 2012:
    This is on by default, should probably say so in the description

    sipa commented at 0:19 am on April 24, 2012:
    It’s not.
  3. in src/net.cpp: in f4fe12f74b outdated
    1359     vector<vector<CService> > vservAddressesToAdd(0);
    1360     BOOST_FOREACH(string& strAddNode, mapMultiArgs["-addnode"])
    1361     {
    1362         vector<CService> vservNode(0);
    1363-        if(Lookup(strAddNode.c_str(), vservNode, GetDefaultPort(), fAllowDNS, 0))
    1364+        if(Lookup(strAddNode.c_str(), vservNode, GetDefaultPort(), fNameLookup, 0)) // TODO TODO TODO
    


    laanwj commented at 3:52 pm on April 23, 2012:
    What’s the TODO?

    sipa commented at 0:20 am on April 24, 2012:
    Nothing anymore.
  4. in src/init.cpp: in 97fc3bc429 outdated
    523@@ -521,13 +524,19 @@ bool AppInit2(int argc, char* argv[])
    524         // Note: the GetBoolArg() calls for all of these must happen later.
    525         SoftSetBoolArg("-listen", false);
    526         SoftSetBoolArg("-irc", false);
    527-        SoftSetBoolArg("-dnsseed", false);
    528+        SoftSetBoolArg("-proxydns", true);
    


    laanwj commented at 4:06 am on April 24, 2012:
    If it’s not supposed to be true by default, why set proxydns to true here?

    sipa commented at 11:23 am on April 24, 2012:
    That’s inside the “if (fTor) { … }” block.

    laanwj commented at 1:47 pm on April 24, 2012:
    ok, good. Sucks that github shows so little context around diffs
  5. sipa commented at 7:15 pm on April 24, 2012: member

    I added a -seednode= option, which causes a short-lived connection to the specified address (which may be a name, and can be passed directly to the proxy, without leaking DNS information) until some peer addresses are returned, and disconnects. This mechanism is used implicitly instead of DNS seeding when -proxydns is enabled.

    The functionality itself doesn’t really fit in this pull request, so I can split it off if requested, but it depends on earlier commits here.

  6. rebroad commented at 2:19 pm on April 28, 2012: contributor

    Is it possible to specify different proxies for different address types, and possibly to even round-robin proxies/non-proxies for certain address types? e.g. for .onion addresses, always use 127.0.0.1:9050, for .i2p, always use 127.0.0.1:4444, and for ipv4 and ipv6 round-robin between 127.0.0.1:9050 and no-proxy.

    I’ve patched by bitcoin to introduce a -proxytoo option, which allows me to 50% randomly use the proxy for each new connection. This is due to sometimes tor working better than noproxy, and other times noproxy working better than tor.

  7. sipa commented at 2:28 pm on April 28, 2012: member
    That shouldn’t be too hard.
  8. SOCKS5 support by default
    Add -socks=<n> to select SOCKS version to use. 4 and 5 are supported,
    5 is default.
    60a87bce87
  9. SOCKS5 connect via hostname 933f2715d8
  10. refactor ConnectSocket a012e2db59
  11. Support connecting by hostnames passed to proxy (-proxydns) 9bab521df8
  12. Add -seednode connections, and use this for -dnsseed + -proxydns 478b01d9a7
  13. jgarzik merged this on May 8, 2012
  14. jgarzik closed this on May 8, 2012

  15. sipa deleted the branch on Jun 23, 2017
  16. suprnurd referenced this in commit 426051687d on Dec 5, 2017
  17. lateminer referenced this in commit da97a2e1a0 on Jan 22, 2019
  18. dawdwadwwdadwadwadwadawdawdwa commented at 0:24 am on November 12, 2019: none
    If Pieter Wuille’s code fails, he didn’t write bad code. The compiler compiled it wrong.
  19. lateminer referenced this in commit 01c517085b on Dec 25, 2019
  20. DrahtBot locked this on Sep 8, 2021

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: 2024-12-18 21:12 UTC

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