Skip to content

Add support for serving HTTP/3#101

Merged
FranzBusch merged 1 commit into
swift-server:mainfrom
aryan-25:serve-http3
Jul 22, 2026
Merged

Add support for serving HTTP/3#101
FranzBusch merged 1 commit into
swift-server:mainfrom
aryan-25:serve-http3

Conversation

@aryan-25

Copy link
Copy Markdown
Collaborator

Motivation

Following from #98, this PR introduces support for serving HTTP/3.

Modifications

  • Added NIOHTTPServer+HTTP3.swift which contains helper methods for setting up a QUIC channel, adding HTTP/3 handlers, and serving HTTP/3 connections.
  • Wired HTTP/3 into makeServerChannels().
    • When HTTP/3 is the only version specified in supportedHTTPVersions, only a QUIC channel is bound to the specified port. When supportedHTTPVersions includes HTTP/1.1 and/or HTTP/2 alongside HTTP/3, the QUIC UDP channel is bound on the same port as the TCP channel serving HTTP/1.1 and/or HTTP/2.
    • Note: I will introduce Alt-Svc advertising in a subsequent PR.

Result

NIOHTTPServer can now serve HTTP/3.

@aryan-25
aryan-25 requested a review from FranzBusch July 20, 2026 20:01
@aryan-25 aryan-25 added 🆕 semver/minor Adds new public API. ⚠️ semver/major Breaks existing public API. and removed 🆕 semver/minor Adds new public API. labels Jul 20, 2026
Comment on lines +61 to +62
remoteAddress: nil,
localAddress: nil,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about those?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HTTP3ServerConnectionMultiplexer vends out a HTTP3ServerConnection for each connection.

The problem is that the underlying connection channel cannot be accessed from HTTP3ServerConnection in its current shape.

I've set these properties to nil until we make some changes in HTTP3ServerConnection.

@FranzBusch
FranzBusch merged commit c2e1f5a into swift-server:main Jul 22, 2026
19 of 25 checks passed
@aryan-25
aryan-25 deleted the serve-http3 branch July 22, 2026 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⚠️ semver/major Breaks existing public API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants