File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -1115,7 +1115,11 @@ def unregisterProtocol(self, p):
11151115
11161116def open_listening_socket (ip , port ):
11171117 try :
1118- s = socket .socket (socket .AF_INET , socket .SOCK_STREAM )
1118+ if isIPv6Address (ip ):
1119+ s = socket .socket (socket .AF_INET6 , socket .SOCK_STREAM )
1120+ else :
1121+ s = socket .socket (socket .AF_INET , socket .SOCK_STREAM )
1122+
11191123 s .setsockopt (socket .SOL_SOCKET , socket .SO_REUSEADDR , 1 )
11201124 s .setblocking (False )
11211125 s .bind ((ip , port ))
@@ -1141,7 +1145,7 @@ def daemon_init(self):
11411145
11421146 i_https = i_http = 0
11431147
1144- for ip in [ipv4 , ipv6 ]:
1148+ for ip in [ipv6 , ipv4 ]:
11451149 if ip is None :
11461150 continue
11471151
Original file line number Diff line number Diff line change @@ -66,8 +66,8 @@ def __init__(self):
6666 self .__dict__ ['processes' ] = 1
6767 self .__dict__ ['requests_per_process' ] = 1000000
6868 self .__dict__ ['transport' ] = 'BOTH'
69- self .__dict__ ['listen_ipv4' ] = '127 .0.0.1 '
70- self .__dict__ ['listen_ipv6' ] = None
69+ self .__dict__ ['listen_ipv4' ] = '0 .0.0.0 '
70+ self .__dict__ ['listen_ipv6' ] = '::'
7171 self .__dict__ ['listen_port_http' ] = 80
7272 self .__dict__ ['listen_port_https' ] = 443
7373 self .__dict__ ['basehost' ] = 'AUTO'
You can’t perform that action at this time.
0 commit comments