Closed iwanbk closed 5 years ago
Hi! This fails because the demo server validates you present an ALPN protocol it understands.
You can fix this like so:
import asyncio
import sys
from aioquic.asyncio import connect
from aioquic.quic.configuration import QuicConfiguration
async def http_client(host, port):
configuration = QuicConfiguration(alpn_protocols=["hq-22"])
async with connect(host, port, configuration=configuration) as connection:
reader, writer = await connection.create_stream()
writer.write(b"GET /\r\n")
writer.write_eof()
response = await reader.read()
sys.stdout.buffer.write(response)
asyncio.get_event_loop().run_until_complete(http_client("quic.aiortc.org", 4433))
Hi, I just tried asyncio API example from https://aioquic.readthedocs.io/en/latest/asyncio.html#asyncio-api and it failed for me. The script
error message
i use python 3.6.5 on Ubuntu 18.04 I got same result with python 3.7.3 on Mac.
Any idea?