feat: add native HTTP/3 (QUIC) server support via ngtcp2/nghttp3#2493
Open
SBALAVIGNESH123 wants to merge 1 commit intodrogonframework:masterfrom
Open
feat: add native HTTP/3 (QUIC) server support via ngtcp2/nghttp3#2493SBALAVIGNESH123 wants to merge 1 commit intodrogonframework:masterfrom
SBALAVIGNESH123 wants to merge 1 commit intodrogonframework:masterfrom
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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