HTTP/2 server: advertise SETTINGS_ENABLE_CONNECT_PROTOCOL for WebSocket-over-h2 (RFC 8441 server side)
Summary
Deno issue #11261 ("Support WebSocket over H2") closed 2026-06-03 covered the client side of RFC 8441. Server-side is not implemented:
Deno.serve's HTTP/2 backend never advertisesSETTINGS_ENABLE_CONNECT_PROTOCOL=1, so clients that speak the extended CONNECT WebSocket handshake fail with an opaque protocol error when ALPN negotiates h2.Consequence: a Deno-based server plus a Deno-based WebSocket client cannot interoperate on h2. If ALPN picks h2, the client's WebSocket upgrade fails; if ALPN picks http/1.1, it works.
Reproduction
Server: any
Deno.serveon TLS with default ALPN (offersh2, http/1.1) usingDeno.upgradeWebSocketin the handler.Client: current-version Deno's built-in
WebSocketdialingwss://against that server.Result: client emits
stream error received: unspecific protocol error detected. The h2 extended CONNECT with:protocol: websocketnever completes because the server didn't sendSETTINGS_ENABLE_CONNECT_PROTOCOL=1.Falls back to working only if the server is forced to drop h2 from ALPN.
Verified against source
ext/http/http_next.rs: no references toenable_connect_protocol,EnableConnectProtocol,:protocol. The h2 server never advertises the setting.Client side works fine: closed issue #11261 quotes the fix confirming the extended CONNECT is sent when ALPN picks h2.
Impact
Any Deno-serving-Deno-clients topology that uses TLS and needs WebSocket has to either strip h2 from server ALPN (reverse proxy sidecar in each client pod) or ship an out-of-band flag to force http/1.1. We hit this in production Kubernetes today, worked around it with an nginx sidecar per client pod.
Ask
On
Deno.servewhen the handler callsDeno.upgradeWebSocket, addSETTINGS_ENABLE_CONNECT_PROTOCOL=1to the h2 SETTINGS frame. Accept an extended CONNECT with:protocol: websocketand route it through the same upgrade handler.Or, if a runtime flag is preferred: expose an option on
Deno.servelike{ enableConnectProtocol: true }.Related
- Closed: #11261 (client side).
- RFC 8441: WebSocket Bootstrapping over HTTP/2.
Happy to test a fix or provide a smaller repro if useful.
Source: denoland/deno