Web / Caddy Server Interview questions
How does Caddy implement HTTP/3 support?
HTTP/3 runs over QUIC, which itself runs over UDP rather than TCP, so Caddy needs a separate code path from its HTTP/1.1 and HTTP/2 handling to support it. Caddy implements this using the quic-go library, a Go implementation of QUIC and HTTP/3.
example.com { reverse_proxy localhost:3000 }
No special directive is required for the snippet above - once automatic HTTPS is active for a site, Caddy listens for HTTP/3 on the same port number as HTTPS (443) but over UDP, alongside the normal TCP listener for HTTP/1.1 and HTTP/2. It then advertises HTTP/3 availability to clients using the Alt-Svc response header, so browsers that already support QUIC can upgrade future requests to that connection automatically, while older clients keep using TCP-based HTTP/2 without any issue. HTTP/3 can be disabled per-server if needed with the protocols global option.
More Related questions...