Connect to Tor hidden services by default
Adds 127.0.0.1:9050 for the .onion proxy if we can succesfully connect to the control port. Natural followup to creating hidden services automatically.
This commit is contained in:
parent
7f9e7a9872
commit
2b30758b2f
|
@ -100,8 +100,9 @@ Zcash has been updated to make use of this.
|
||||||
|
|
||||||
This means that if Tor is running (and proper authorization is available),
|
This means that if Tor is running (and proper authorization is available),
|
||||||
Zcash automatically creates a hidden service to listen on, without
|
Zcash automatically creates a hidden service to listen on, without
|
||||||
manual configuration. This will positively affect the number of available
|
manual configuration. Zcash will also use Tor automatically to connect
|
||||||
.onion nodes.
|
to other .onion nodes if the control socket can be successfully opened. This
|
||||||
|
will positively affect the number of available .onion nodes and their usage.
|
||||||
|
|
||||||
This new feature is enabled by default if Zcash is listening, and
|
This new feature is enabled by default if Zcash is listening, and
|
||||||
a connection to Tor can be made. It can be configured with the `-listenonion`,
|
a connection to Tor can be made. It can be configured with the `-listenonion`,
|
||||||
|
|
|
@ -449,6 +449,15 @@ void TorController::auth_cb(TorControlConnection& conn, const TorControlReply& r
|
||||||
{
|
{
|
||||||
if (reply.code == 250) {
|
if (reply.code == 250) {
|
||||||
LogPrint("tor", "tor: Authentication succesful\n");
|
LogPrint("tor", "tor: Authentication succesful\n");
|
||||||
|
|
||||||
|
// Now that we know Tor is running setup the proxy for onion addresses
|
||||||
|
// if -onion isn't set to something else.
|
||||||
|
if (GetArg("-onion", "") == "") {
|
||||||
|
proxyType addrOnion = proxyType(CService("127.0.0.1", 9050), true);
|
||||||
|
SetProxy(NET_TOR, addrOnion);
|
||||||
|
SetReachable(NET_TOR);
|
||||||
|
}
|
||||||
|
|
||||||
// Finally - now create the service
|
// Finally - now create the service
|
||||||
if (private_key.empty()) // No private key, generate one
|
if (private_key.empty()) // No private key, generate one
|
||||||
private_key = "NEW:BEST";
|
private_key = "NEW:BEST";
|
||||||
|
|
Loading…
Reference in New Issue