1aioquic 2======= 3 4|rtd| |pypi-v| |pypi-pyversions| |pypi-l| |tests| |codecov| |black| 5 6.. |rtd| image:: https://readthedocs.org/projects/aioquic/badge/?version=latest 7 :target: https://aioquic.readthedocs.io/ 8 9.. |pypi-v| image:: https://img.shields.io/pypi/v/aioquic.svg 10 :target: https://pypi.python.org/pypi/aioquic 11 12.. |pypi-pyversions| image:: https://img.shields.io/pypi/pyversions/aioquic.svg 13 :target: https://pypi.python.org/pypi/aioquic 14 15.. |pypi-l| image:: https://img.shields.io/pypi/l/aioquic.svg 16 :target: https://pypi.python.org/pypi/aioquic 17 18.. |tests| image:: https://github.com/aiortc/aioquic/workflows/tests/badge.svg 19 :target: https://github.com/aiortc/aioquic/actions 20 21.. |codecov| image:: https://img.shields.io/codecov/c/github/aiortc/aioquic.svg 22 :target: https://codecov.io/gh/aiortc/aioquic 23 24.. |black| image:: https://img.shields.io/badge/code%20style-black-000000.svg 25 :target: https://github.com/python/black 26 27What is ``aioquic``? 28-------------------- 29 30``aioquic`` is a library for the QUIC network protocol in Python. It features 31a minimal TLS 1.3 implementation, a QUIC stack and an HTTP/3 stack. 32 33QUIC standardisation is not finalised yet, but ``aioquic`` closely tracks the 34specification drafts and is regularly tested for interoperability against other 35`QUIC implementations`_. 36 37To learn more about ``aioquic`` please `read the documentation`_. 38 39Why should I use ``aioquic``? 40----------------------------- 41 42``aioquic`` has been designed to be embedded into Python client and server 43libraries wishing to support QUIC and / or HTTP/3. The goal is to provide a 44common codebase for Python libraries in the hope of avoiding duplicated effort. 45 46Both the QUIC and the HTTP/3 APIs follow the "bring your own I/O" pattern, 47leaving actual I/O operations to the API user. This approach has a number of 48advantages including making the code testable and allowing integration with 49different concurrency models. 50 51Features 52-------- 53 54- QUIC stack conforming with draft-27 55- HTTP/3 stack conforming with draft-27 56- minimal TLS 1.3 implementation 57- IPv4 and IPv6 support 58- connection migration and NAT rebinding 59- logging TLS traffic secrets 60- logging QUIC events in QLOG format 61- HTTP/3 server push support 62 63Requirements 64------------ 65 66``aioquic`` requires Python 3.6 or better, and the OpenSSL development headers. 67 68Linux 69..... 70 71On Debian/Ubuntu run: 72 73.. code-block:: console 74 75 $ sudo apt install libssl-dev python3-dev 76 77On Alpine Linux you will also need the following: 78 79.. code-block:: console 80 81 $ sudo apt install bsd-compat-headers libffi-dev 82 83OS X 84.... 85 86On OS X run: 87 88.. code-block:: console 89 90 $ brew install openssl 91 92You will need to set some environment variables to link against OpenSSL: 93 94.. code-block:: console 95 96 $ export CFLAGS=-I/usr/local/opt/openssl/include 97 $ export LDFLAGS=-L/usr/local/opt/openssl/lib 98 99Windows 100....... 101 102On Windows the easiest way to install OpenSSL is to use `Chocolatey`_. 103 104.. code-block:: console 105 106 > choco install openssl 107 108You will need to set some environment variables to link against OpenSSL: 109 110.. code-block:: console 111 112 > $Env:CL = "/IC:\Progra~1\OpenSSL-Win64\include" 113 > $Env:LINK = "/LIBPATH:C:\Progra~1\OpenSSL-Win64\lib" 114 115Running the examples 116-------------------- 117 118After checking out the code using git you can run: 119 120.. code-block:: console 121 122 $ pip install -e . 123 $ pip install aiofiles asgiref httpbin starlette wsproto 124 125HTTP/3 server 126............. 127 128You can run the example server, which handles both HTTP/0.9 and HTTP/3: 129 130.. code-block:: console 131 132 $ python examples/http3_server.py --certificate tests/ssl_cert.pem --private-key tests/ssl_key.pem 133 134HTTP/3 client 135............. 136 137You can run the example client to perform an HTTP/3 request: 138 139.. code-block:: console 140 141 $ python examples/http3_client.py --ca-certs tests/pycacert.pem https://localhost:4433/ 142 143Alternatively you can perform an HTTP/0.9 request: 144 145.. code-block:: console 146 147 $ python examples/http3_client.py --ca-certs tests/pycacert.pem --legacy-http https://localhost:4433/ 148 149You can also open a WebSocket over HTTP/3: 150 151.. code-block:: console 152 153 $ python examples/http3_client.py --ca-certs tests/pycacert.pem wss://localhost:4433/ws 154 155License 156------- 157 158``aioquic`` is released under the `BSD license`_. 159 160.. _read the documentation: https://aioquic.readthedocs.io/en/latest/ 161.. _QUIC implementations: https://github.com/quicwg/base-drafts/wiki/Implementations 162.. _cryptography: https://cryptography.io/ 163.. _Chocolatey: https://chocolatey.org/ 164.. _BSD license: https://aioquic.readthedocs.io/en/latest/license.html 165