mirror of
https://github.com/Kozea/Radicale.git
synced 2025-06-26 16:45:52 +00:00
Use IP instead of hostname localhost
This commit is contained in:
parent
44d84baa5a
commit
8fe2d987e0
1 changed files with 2 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue