Skip to content

feat: add native HTTP/3 (QUIC) server support via ngtcp2/nghttp3#2493

Open
SBALAVIGNESH123 wants to merge 1 commit intodrogonframework:masterfrom
SBALAVIGNESH123:feature/http3-support
Open

feat: add native HTTP/3 (QUIC) server support via ngtcp2/nghttp3#2493
SBALAVIGNESH123 wants to merge 1 commit intodrogonframework:masterfrom
SBALAVIGNESH123:feature/http3-support

Conversation

@SBALAVIGNESH123
Copy link
Copy Markdown
Contributor

This adds native HTTP/3 support to Drogon by integrating ngtcp2 and nghttp3 directly into the existing Trantor event loop. The implementation introduces a QuicServer that manages UDP sockets and dispatches incoming QUIC packets to per-client QuicConnection instances, each of which wraps the full ngtcp2 transport state machine and an nghttp3 HTTP/3 session. Incoming requests are parsed into the same HttpRequestImpl objects used by HTTP/1.1 and HTTP/2, so they flow through the existing routing, middleware, and controller pipeline without any changes needed on the application side.
The TLS layer enforces TLS 1.3 with mandatory ALPN selection for h3, and supports both the older ngtcp2 crypto_quictls backend and the newer crypto_ossl backend introduced in ngtcp2 v1.x. The server handles version negotiation, stateless retry, stateless reset tokens, ECN signaling, and works with both IPv4 and IPv6. An Alt-Svc middleware is also included so browsers can automatically discover and upgrade to HTTP/3.

The feature is gated behind a BUILD_HTTP3 CMake option (off by default) and requires libngtcp2, libngtcp2_crypto_quictls (or libngtcp2_crypto_ossl), and libnghttp3 to be available via pkg-config. When disabled, zero existing code is affected.

Closes #2243
Ref #349

This adds native HTTP/3 support to Drogon by integrating ngtcp2 and nghttp3 directly into the existing Trantor event loop. The implementation introduces a QuicServer that manages UDP sockets and dispatches incoming QUIC packets to per-client QuicConnection instances, each of which wraps the full ngtcp2 transport state machine and an nghttp3 HTTP/3 session. Incoming requests are parsed into the same HttpRequestImpl objects used by HTTP/1.1 and HTTP/2, so they flow through the existing routing, middleware, and controller pipeline without any changes needed on the application side.

The TLS layer enforces TLS 1.3 with mandatory ALPN selection for h3, and supports both the older ngtcp2 crypto_quictls backend and the newer crypto_ossl backend introduced in ngtcp2 v1.x. The server handles version negotiation, stateless retry, stateless reset tokens, ECN signaling, and works with both IPv4 and IPv6. An Alt-Svc middleware is also included so browsers can automatically discover and upgrade to HTTP/3.

The feature is gated behind a BUILD_HTTP3 CMake option (off by default) and requires libngtcp2, libngtcp2_crypto_quictls (or libngtcp2_crypto_ossl), and libnghttp3 to be available via pkg-config. When disabled, zero existing code is affected.

Closes drogonframework#2243
Ref drogonframework#349
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

QUIC Support

1 participant