Skip to content

Commit

Permalink
Fix autobind on IPv6
Browse files Browse the repository at this point in the history
  • Loading branch information
evilaliv3 committed Oct 1, 2019
1 parent 3354ef5 commit 7920f58
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions tor2web/t2w.py
Original file line number Diff line number Diff line change
Expand Up @@ -1141,7 +1141,11 @@ def daemon_init(self):

i_https = i_http = 0

for ip in [ipv4, ipv6]:
ips = [ipv6]
if ipv6 != '::':
ipv.append(ipv4)

for ip in ips:
if ip is None:
continue

Expand Down Expand Up @@ -1350,7 +1354,7 @@ def umask(mask):
print(("Tor2web Startup Failure: unexistent file (%s)" % config.ssl_cert))
exit(1)

if config.listen_ipv6 == "::" or config.listen_ipv4 == config.listen_ipv6:
if config.listen_ipv4 == "::" or config.listen_ipv4 == config.listen_ipv6:
# fix for incorrect configurations
ipv4 = None
else:
Expand Down
4 changes: 2 additions & 2 deletions tor2web/utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ def __init__(self):
self.__dict__['processes'] = 1
self.__dict__['requests_per_process'] = 1000000
self.__dict__['transport'] = 'BOTH'
self.__dict__['listen_ipv4'] = '127.0.0.1'
self.__dict__['listen_ipv6'] = None
self.__dict__['listen_ipv4'] = '0.0.0.0'
self.__dict__['listen_ipv6'] = '::'
self.__dict__['listen_port_http'] = 80
self.__dict__['listen_port_https'] = 443
self.__dict__['basehost'] = 'AUTO'
Expand Down

0 comments on commit 7920f58

Please sign in to comment.