tor_password argument...

This commit is contained in:
erqan 2016-12-27 17:15:02 +03:00
parent 9a1735f37d
commit a3f62f56f6
2 changed files with 3 additions and 0 deletions

View File

@ -180,6 +180,7 @@ class Config(object):
self.parser.add_argument('--tor', help='enable: Use only for Tor peers, always: Use Tor for every connection', choices=["disable", "enable", "always"], default='enable')
self.parser.add_argument('--tor_controller', help='Tor controller address', metavar='ip:port', default='127.0.0.1:9051')
self.parser.add_argument('--tor_proxy', help='Tor proxy address', metavar='ip:port', default='127.0.0.1:9050')
self.parser.add_argument('--tor_password', help='Tor controller password', metavar='password')
self.parser.add_argument('--version', action='version', version='ZeroNet %s r%s' % (self.version, self.rev))

View File

@ -167,6 +167,8 @@ class TorManager:
cookie_file = cookie_match.group(1)
auth_hex = binascii.b2a_hex(open(cookie_file, "rb").read())
res_auth = self.send("AUTHENTICATE %s" % auth_hex, conn)
elif config.tor_password:
res_auth = self.send('AUTHENTICATE "%s"' % config.tor_password, conn)
else:
res_auth = self.send("AUTHENTICATE", conn)