|
|
|
@ -1199,6 +1199,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
@@ -1199,6 +1199,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|
|
|
|
// -proxy sets a proxy for all outgoing network traffic
|
|
|
|
|
// -noproxy (or -proxy=0) as well as the empty string can be used to not set a proxy, this is the default
|
|
|
|
|
std::string proxyArg = GetArg("-proxy", ""); |
|
|
|
|
SetLimited(NET_TOR); |
|
|
|
|
if (proxyArg != "" && proxyArg != "0") { |
|
|
|
|
proxyType addrProxy = proxyType(CService(proxyArg, 9050), proxyRandomize); |
|
|
|
|
if (!addrProxy.IsValid()) |
|
|
|
@ -1208,7 +1209,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
@@ -1208,7 +1209,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|
|
|
|
SetProxy(NET_IPV6, addrProxy); |
|
|
|
|
SetProxy(NET_TOR, addrProxy); |
|
|
|
|
SetNameProxy(addrProxy); |
|
|
|
|
SetReachable(NET_TOR); // by default, -proxy sets onion as reachable, unless -noonion later
|
|
|
|
|
SetLimited(NET_TOR, false); // by default, -proxy sets onion as reachable, unless -noonion later
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// -onion can be used to set only a proxy for .onion, or override normal proxy for .onion addresses
|
|
|
|
@ -1217,13 +1218,13 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
@@ -1217,13 +1218,13 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|
|
|
|
std::string onionArg = GetArg("-onion", ""); |
|
|
|
|
if (onionArg != "") { |
|
|
|
|
if (onionArg == "0") { // Handle -noonion/-onion=0
|
|
|
|
|
SetReachable(NET_TOR, false); // set onions as unreachable
|
|
|
|
|
SetLimited(NET_TOR); // set onions as unreachable
|
|
|
|
|
} else { |
|
|
|
|
proxyType addrOnion = proxyType(CService(onionArg, 9050), proxyRandomize); |
|
|
|
|
if (!addrOnion.IsValid()) |
|
|
|
|
return InitError(strprintf(_("Invalid -onion address: '%s'"), onionArg)); |
|
|
|
|
SetProxy(NET_TOR, addrOnion); |
|
|
|
|
SetReachable(NET_TOR); |
|
|
|
|
SetLimited(NET_TOR, false); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|