Skip to content

Latest commit

 

History

History

examples

Examples

After checking out the code using git you can run:

$ pip install -e .
$ pip install aiofiles asgiref dnslib httpbin starlette wsproto

HTTP/3

HTTP/3 server

You can run the example server, which handles both HTTP/0.9 and HTTP/3:

$ python examples/http3_server.py --certificate tests/ssl_cert.pem --private-key tests/ssl_key.pem

HTTP/3 client

You can run the example client to perform an HTTP/3 request:

$ python examples/http3_client.py --ca-certs tests/pycacert.pem https://localhost:4433/

Alternatively you can perform an HTTP/0.9 request:

$ python examples/http3_client.py --ca-certs tests/pycacert.pem --legacy-http https://localhost:4433/

You can also open a WebSocket over HTTP/3:

$ python examples/http3_client.py --ca-certs tests/pycacert.pem wss://localhost:4433/ws

DNS over QUIC

By default the server will use the Google Public DNS service, you can override this with the --resolver argument.

$ python examples/doq_server.py --certificate tests/ssl_cert.pem --private-key tests/ssl_key.pem

You can then run the client with a specific query:

$ python examples/doq_client.py --ca-certs tests/pycacert.pem --dns_type "A" --query "quic.aiortc.org" --port 4784