Run HTTP/3

← Protocols and TLS

HTTP/3 carries requests over QUIC on UDP. A TCP companion accepts HTTPS connections and advertises the QUIC endpoint. Verify the UDP path directly before testing browser discovery.

Install a QUIC backend

Complete the base PHP installation. Check php --ri ffi and php --ri openssl. Install one compatible QUIC backend in the server environment.

quiche
On Homebrew, run brew install cloudflare-quiche. For a custom build, use a shared library with the quiche FFI API matching the server release and the host architecture and libc. Use protocols.http3.quiche.library for a nonstandard location.
ngtcp2 with nghttp3
Install ngtcp2 1.22+ and nghttp3 1.14+ with a compatible TLS provider, development headers, pkg-config and a C toolchain. Run make -C vendor/mini4work/webserver/native/ngtcp2 to build the supplied adapter. Rebuild after upgrading the server. Discovery tries quiche first, then the adapter. See the platform-specific build instructions.

Start the listener

Save this as http3.json next to vendor/. Stop any other server using port 9000, then start this profile. Explicit selection reports missing backend dependencies at startup.

JSON
{
  "listen": { "port": 9000 },
  "protocols": { "http": "3" },
  "tls": {
    "mode": "local",
    "storage": "var/tls",
    "local": { "trust_ca": "off" }
  }
}
Shell
php -d ffi.enable=true vendor/mini4work/webserver/examples/server.php http3.json

Verify UDP and certificate trust

Run curl -V on the client. It must list HTTP3. Substitute the public CA path from tls.trust.root in the startup log.

Shell
CA=/path/from/tls.trust.root
curl --http3-only --cacert "$CA" -sS -o /dev/null \
  -w 'HTTP/%{http_version} %{http_code}\n' https://127.0.0.1:9000/

Expect HTTP/3 200. An unsupported curl option means the client lacks HTTP/3. A timeout with working TCP HTTPS points to the UDP path. For a container, bind to a reachable address and publish both TCP and UDP. When the external UDP port differs, set protocols.http3.public_port to the external port for Alt-Svc discovery.