This project demonstrates a basic QUIC server and client implementation in Python using aioquic and hypercorn (running a FastAPI application).
- Python 3.8+
- poetry
openssl(for generating self-signed certificates)make(for running examples)
To install all dependencies:
poetry installTo get into the virtual environment:
eval $(poetry env activate)You can found a simple aioquic server in examples/aioquic/server.py. To run it, you can use make, as below.
make aioquicNote
The HTTP/3 isn't a FastAPI feature, but a hypercorn feature.
You can found a simple FastAPI application in examples/fastapi/server.py. To run it using hypercorn, you can use make, as below.
make fastapiYou can use curl to test the server. HTTP/3 isn't officially supported by stable curl distributions, but we can enable it compiling curl with HTTP/3 flags.
To improve the example, I got a ready to use docker image with this setup. At the Makefile you can find two targets simplifying the process.
To test the server, run:
make testOr, to see more details:
make test-verbose