Developers can handle QUIC and HTTP/3 packets directly with low-level APIs
quiche provides the tools needed for developers who must write code to convert bytes from a socket into QUIC connection state and generate packets to send back to the network. It is a Rust library implementing the QUIC transport protocol and HTTP/3 according to IETF standards. The application handles input/output tasks such as socket processing and event loops, while quiche layers the protocol logic on top.
Why it is already used by Cloudflare and Android
This library handles HTTP/3 support on the Cloudflare edge network. It is also used by the Android DNS resolver to implement DNS over HTTP/3. It is integrated into curl to provide HTTP/3 support. These real-world service cases demonstrate the stability of the protocol implementation.
Connection setup and packet processing flow
To start a connection, you first create a Config object to set the QUIC version, ALPN ID, flow control, congestion control, and idle timeout. Because QUIC is a general-purpose transport protocol, values such as the number of concurrent streams or data limits must vary depending on the nature of the application, so quiche defaults some values to 0. Developers must specify the required values directly using methods like set_initial_max_streams_bidi(). Clients create connections with the connect() function, while servers use accept(). Subsequently, incoming packets are processed with recv(), and outgoing packets are generated with send(). At this point, quiche informs you of the timer expiration time via the timeout() method, and the application must call on_timeout() at that time to check whether additional packets need to be sent.
Stream data exchange and the HTTP/3 module
Once the handshake is complete, you can exchange stream data using the stream_send() and stream_recv() methods. The readable() method returns a list of streams with data available to read, so you can iterate through them to read the data. quiche also provides an HTTP/3 module, a high-level API for handling HTTP requests and responses over QUIC. Using this module allows you to handle HTTP traffic without dealing with protocol details.
C/C++ integration and build environment
A thin C API is provided on top of the Rust API, allowing quiche to be used in C/C++ applications or other languages that support FFI. The libquiche.a static library is automatically generated during cargo build, and you must enable the --features ffi option to use the FFI API. Building requires Rust 1.88 or higher and BoringSSL. BoringSSL is used as a TLS-based component for the QUIC cryptographic handshake and requires the cmake command during the build process. Windows additionally requires NASM. When building for Android or iOS, you use tools like cargo-ndk or cargo-lipo respectively to generate libraries for specific architectures.
Things to check before use
Because quiche provides low-level APIs, you must implement network input/output infrastructure such as socket handling, event loops, and timer management yourself. The client and server example apps included in the repository are intended to demonstrate API usage and do not guarantee performance, security, or reliability, so they should not be used as-is in production environments. If you plan a production deployment, you should check BoringSSL version compatibility and additional dependencies for target platforms (Windows, Android, iOS), such as NASM, NDK, and Xcode, in advance.