|0.10.6||Nov 7, 2023|
|0.10.4||Aug 24, 2023|
|0.10.1||May 11, 2023|
|0.9.3||Mar 28, 2023|
|0.1.0||Oct 2, 2018|
#1 in #protocol
436,038 downloads per month
Used in 746 crates (34 directly)
Quinn is a pure-rust, async-compatible implementation of the IETF QUIC transport protocol.
- Simultaneous client/server operation
- Ordered and unordered stream reads for improved performance
- Works on stable Rust, tested on Linux, macOS and Windows
- Pluggable cryptography, with a standard implementation backed by rustls and ring
- Application-layer datagrams for small, unreliable messages
- Future-based async API
- Minimum supported Rust version of 1.63.0
- quinn: High-level async API based on tokio, see for usage. This will be used by most developers. (Basic benchmarks are included.)
- quinn-proto: Deterministic state machine of the protocol which performs no I/O internally and is suitable for use with custom event loops (and potentially a C or C++ API).
- quinn-udp: UDP sockets with ECN information tuned for the protocol.
- bench: Benchmarks without any framework.
- fuzz: Fuzz tests.
$ cargo run --example server ./ $ cargo run --example client https://localhost:4433/Cargo.toml
This launches an HTTP 0.9 server on the loopback address serving the current
working directory, with the client fetching
./Cargo.toml. By default, the
server generates a self-signed certificate and stores it to disk, where the
client will automatically find and trust it.
Click to show the notes
A Quinn endpoint corresponds to a single UDP socket, no matter how many
connections are in use. Handling high aggregate data rates on a single endpoint
can require a larger UDP buffer than is configured by default in most
environments. If you observe erratic latency and/or throughput over a stable
network link, consider increasing the buffer sizes used. For example, you could
SO_RCVBUF options of the UDP socket to be used
before passing it in to Quinn. Note that some platforms (e.g. Linux) require
elevated privileges or modified system configuration for a process to increase
its UDP buffer sizes.
By default, Quinn clients validate the cryptographic identity of servers they connect to. This prevents an active, on-path attacker from intercepting messages, but requires trusting some certificate authority. For many purposes, this can be accomplished by using certificates from Let's Encrypt for servers, and relying on the default configuration for clients.
For some cases, including peer-to-peer, trust-on-first-use, deliberately
insecure applications, or any case where servers are not identified by domain
name, this isn't practical. Arbitrary certificate validation logic can be
implemented by enabling the
dangerous_configuration feature of
constructing a Quinn
ClientConfig with an overridden certificate verifier by
When operating your own certificate authority doesn't make sense, rcgen can be used to generate self-signed certificates on demand. To support trust-on-first-use, servers that automatically generate self-signed certificates should write their generated certificate to persistent storage and reuse it on future runs.
All feedback welcome. Feel free to file bugs, requests for documentation and any other feedback to the issue tracker.
The quinn-proto test suite uses simulated IO for reproducibility and to avoid
long sleeps in certain timing-sensitive tests. If the
environment variable is set, the tests will emit UDP packets for inspection
using external protocol analyzers like Wireshark, and NSS-compatible key logs
for the client side of each connection will be written to the path specified in
The minimum supported Rust version for published releases of our crates will always be at least 6 months old at the time of release.
- Dirkjan Ochtman - Project owner & founder
- Benjamin Saunders - Project owner & founder
- Jean-Christophe Begue - Project collaborator, author of the HTTP/3 Implementation
Low-level protocol logic for the QUIC protoocol
quinn-proto contains a fully deterministic implementation of QUIC protocol logic. It contains no networking code and does not get any relevant timestamps from the operating system. Most users may want to use the futures-based quinn API instead.
The quinn-proto API might be of interest if you want to use it from a C or C++ project through C bindings or if you want to use a different event loop than the one tokio provides.
The most important types are
Endpoint, which conceptually represents the protocol state for
a single socket and mostly manages configuration and dispatches incoming datagrams to the
Connection types contain the bulk of the protocol logic related to
managing a single connection and all the related state (such as streams).