HTTP/3 support
Otoroshi supports HTTP/3 (QUIC) both as a server (accepting HTTP/3 connections from clients) and as a client (calling backends over HTTP/3). HTTP/3 runs over the QUIC protocol using UDP, providing faster connection establishment (0-RTT), better handling of packet loss, and connection migration compared to TCP-based HTTP/2.
The implementation is based on netty-incubator-codec-quic and netty-incubator-codec-http3.
HTTP/3 server
Enable HTTP/3
HTTP/3 requires the Netty server to be enabled. Add the following configuration:
otoroshi.next.experimental.netty-server.enabled = true
otoroshi.next.experimental.netty-server.http3.enabled = true
otoroshi.next.experimental.netty-server.http3.port = 10048
Or via environment variables:
OTOROSHI_NEXT_EXPERIMENTAL_NETTY_SERVER_ENABLED=true
OTOROSHI_NEXT_EXPERIMENTAL_NETTY_SERVER_HTTP3_ENABLED=true
OTOROSHI_NEXT_EXPERIMENTAL_NETTY_SERVER_HTTP3_PORT=10048
On startup, the log will show the HTTP/3 listener:
root [info] otoroshi-experimental-netty-server -
root [info] otoroshi-experimental-netty-server - Starting the experimental Netty Server !!!
root [info] otoroshi-experimental-netty-server -
root [info] otoroshi-experimental-netty-server - https://0.0.0.0:10048 (HTTP/3)
root [info] otoroshi-experimental-netty-server - https://0.0.0.0:10048 (HTTP/1.1, HTTP/2)
root [info] otoroshi-experimental-netty-server - http://0.0.0.0:10049 (HTTP/1.1, HTTP/2 H2C)
root [info] otoroshi-experimental-netty-server -
The HTTP/3 server can share the same port number as the HTTPS server because QUIC uses UDP while HTTPS uses TCP.
Server configuration
| Config key | Default | Env variable | Description |
|---|---|---|---|
http3.enabled | false | OTOROSHI_NEXT_EXPERIMENTAL_NETTY_SERVER_HTTP3_ENABLED | Enable HTTP/3 |
http3.port | 10048 | OTOROSHI_NEXT_EXPERIMENTAL_NETTY_SERVER_HTTP3_PORT | UDP port for QUIC |
http3.exposedPort | 10048 | OTOROSHI_NEXT_EXPERIMENTAL_NETTY_SERVER_HTTP3_EXPOSED_PORT | Externally visible HTTP/3 port (used in alt-svc headers) |
http3.maxSendUdpPayloadSize | 1500 | OTOROSHI_NEXT_EXPERIMENTAL_NETTY_SERVER_HTTP3_MAX_SEND_UDP_PAYLOAD_SIZE | Maximum outgoing UDP payload size (bytes) |
http3.maxRecvUdpPayloadSize | 1500 | OTOROSHI_NEXT_EXPERIMENTAL_NETTY_SERVER_HTTP3_MAX_RECV_UDP_PAYLOAD_SIZE | Maximum incoming UDP payload size (bytes) |
http3.initialMaxData | 10000000 | OTOROSHI_NEXT_EXPERIMENTAL_NETTY_SERVER_HTTP_3_INITIAL_MAX_DATA | Initial flow control limit per connection (bytes) |
http3.initialMaxStreamDataBidirectionalLocal | 1000000 | OTOROSHI_NEXT_EXPERIMENTAL_NETTY_SERVER_HTTP_3_INITIAL_MAX_STREAM_DATA_BIDIRECTIONAL_LOCAL | Initial flow control limit per locally-initiated stream (bytes) |
http3.initialMaxStreamDataBidirectionalRemote | 1000000 | OTOROSHI_NEXT_EXPERIMENTAL_NETTY_SERVER_HTTP_3_INITIAL_MAX_STREAM_DATA_BIDIRECTIONAL_REMOTE | Initial flow control limit per remotely-initiated stream (bytes) |
http3.initialMaxStreamsBidirectional | 100000 | OTOROSHI_NEXT_EXPERIMENTAL_NETTY_SERVER_HTTP_3_INITIAL_MAX_STREAMS_BIDIRECTIONAL | Maximum number of concurrent bidirectional streams |
http3.disableQpackDynamicTable | true | OTOROSHI_NEXT_EXPERIMENTAL_NETTY_SERVER_HTTP_3_DISABLE_QPACK_DYNAMIC_TABLE | Disable QPACK dynamic table for header compression. Disabled by default for browser compatibility |
Full configuration example
otoroshi.next.experimental.netty-server {
enabled = true
http3 {
enabled = true
port = 10048
exposedPort = 443
maxSendUdpPayloadSize = 1500
maxRecvUdpPayloadSize = 1500
initialMaxData = 10000000
initialMaxStreamDataBidirectionalLocal = 1000000
initialMaxStreamDataBidirectionalRemote = 1000000
initialMaxStreamsBidirectional = 100000
disableQpackDynamicTable = true
}
}