mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
Add -noproxy to circumvent proxy for some network
This commit is contained in:
13
src/init.cpp
13
src/init.cpp
@@ -180,6 +180,7 @@ bool AppInit2(int argc, char* argv[])
|
||||
" -timeout=<n> \t " + _("Specify connection timeout (in milliseconds)") + "\n" +
|
||||
" -proxy=<ip:port> \t " + _("Connect through socks proxy") + "\n" +
|
||||
" -socks=<n> \t " + _("Select the version of socks proxy to use (4 or 5, 5 is default)") + "\n" +
|
||||
" -noproxy=<net> \t " + _("Do not use proxy for connections to network net (ipv4 or ipv6)") + "\n" +
|
||||
" -dns \t " + _("Allow DNS lookups for -addnode, -seednode and -connect") + "\n" +
|
||||
" -proxydns \t " + _("Pass DNS requests to (SOCKS5) proxy") + "\n" +
|
||||
" -port=<port> \t\t " + _("Listen for connections on <port> (default: 8333 or testnet: 18333)") + "\n" +
|
||||
@@ -532,6 +533,18 @@ bool AppInit2(int argc, char* argv[])
|
||||
}
|
||||
}
|
||||
|
||||
if (mapArgs.count("-noproxy"))
|
||||
{
|
||||
BOOST_FOREACH(std::string snet, mapMultiArgs["-noproxy"]) {
|
||||
enum Network net = ParseNetwork(snet);
|
||||
if (net == NET_UNROUTABLE) {
|
||||
ThreadSafeMessageBox(_("Unknown network specified in -noproxy"), _("Bitcoin"), wxOK | wxMODAL);
|
||||
return false;
|
||||
}
|
||||
SetNoProxy(net);
|
||||
}
|
||||
}
|
||||
|
||||
if (mapArgs.count("-connect"))
|
||||
SoftSetBoolArg("-dnsseed", false);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user