mirror of
https://github.com/onionshare/onionshare.git
synced 2024-10-01 01:35:40 -04:00
Try to get the Tor ControlPort from the environment.
... via the TOR_CONTROL_PORT variable. If set, onionshare will only try this port.
This commit is contained in:
parent
373f24e64b
commit
c74d892968
@ -57,7 +57,11 @@ class Onion(object):
|
||||
# connect to the tor controlport
|
||||
found_tor = False
|
||||
self.c = None
|
||||
ports = [9151, 9153, 9051]
|
||||
env_port = os.environ.get('TOR_CONTROL_PORT')
|
||||
if env_port:
|
||||
ports = [int(env_port)]
|
||||
else:
|
||||
ports = [9151, 9153, 9051]
|
||||
for port in ports:
|
||||
try:
|
||||
self.c = Controller.from_port(port=port)
|
||||
|
Loading…
Reference in New Issue
Block a user