Use IP instead of hostname localhost
This commit is contained in:
parent
44d84baa5a
commit
8fe2d987e0
@ -56,7 +56,7 @@ class TestBaseServerRequests:
|
|||||||
self.shutdown_socket, shutdown_socket_out = socket.socketpair()
|
self.shutdown_socket, shutdown_socket_out = socket.socketpair()
|
||||||
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:
|
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:
|
||||||
# Find available port
|
# Find available port
|
||||||
sock.bind(("localhost", 0))
|
sock.bind(("127.0.0.1", 0))
|
||||||
self.sockname = sock.getsockname()
|
self.sockname = sock.getsockname()
|
||||||
self.configuration["server"]["hosts"] = "[%s]:%d" % self.sockname
|
self.configuration["server"]["hosts"] = "[%s]:%d" % self.sockname
|
||||||
self.thread = threading.Thread(target=server.serve, args=(
|
self.thread = threading.Thread(target=server.serve, args=(
|
||||||
@ -117,7 +117,7 @@ class TestBaseServerRequests:
|
|||||||
with socket.socket(socket.AF_INET6, socket.SOCK_STREAM) as sock:
|
with socket.socket(socket.AF_INET6, socket.SOCK_STREAM) as sock:
|
||||||
sock.setsockopt(server.IPPROTO_IPV6, server.IPV6_V6ONLY, 1)
|
sock.setsockopt(server.IPPROTO_IPV6, server.IPV6_V6ONLY, 1)
|
||||||
# Find available port
|
# Find available port
|
||||||
sock.bind(("localhost", 0))
|
sock.bind(("::1", 0))
|
||||||
self.sockname = sock.getsockname()[:2]
|
self.sockname = sock.getsockname()[:2]
|
||||||
self.configuration["server"]["hosts"] = "[%s]:%d" % self.sockname
|
self.configuration["server"]["hosts"] = "[%s]:%d" % self.sockname
|
||||||
self.thread.start()
|
self.thread.start()
|
||||||
|
Loading…
Reference in New Issue
Block a user