Skip to content

Commit b4ce22b

Browse files
committed
Never use :: in tests without dual-stack
1 parent 44c31e1 commit b4ce22b

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/aioquic/asyncio/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ async def connect(
5252
0-RTT.
5353
* ``local_port`` is the UDP port number that this client wants to bind.
5454
* ``dual_stack`` is a flag which enabled or disabled using IPv4/IPv6 Dual-Stack.
55-
The default value is platform specific and similar with socket.has_dualstack_ipv6().
55+
The default value is platform specific and similar to socket.has_dualstack_ipv6()
5656
"""
5757
loop = asyncio.get_event_loop()
5858

tests/test_asyncio.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,11 @@ async def run_client(
100100
return response
101101

102102
@contextlib.asynccontextmanager
103-
async def run_server(self, configuration=None, host="::", **kwargs):
103+
async def run_server(self, configuration=None, host=None, **kwargs):
104+
if host is None and not socket.has_dualstack_ipv6():
105+
host = "127.0.0.1"
106+
elif host is None:
107+
host = "::"
104108
if configuration is None:
105109
configuration = QuicConfiguration(is_client=False)
106110
configuration.load_cert_chain(SERVER_CERTFILE, SERVER_KEYFILE)

0 commit comments

Comments
 (0)