#36833·deno

HTTP/2 server: advertise SETTINGS_ENABLE_CONNECT_PROTOCOL for WebSocket-over-h2 (RFC 8441 server side)

Author: bixuCreated Sep 14, 2026Updated Sep 14, 2026

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 advertises SETTINGS_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.serve on TLS with default ALPN (offers h2, http/1.1) using Deno.upgradeWebSocket in the handler.

Client: current-version Deno's built-in WebSocket dialing wss:// against that server.

Result: client emits stream error received: unspecific protocol error detected. The h2 extended CONNECT with :protocol: websocket never completes because the server didn't send SETTINGS_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 to enable_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.serve when the handler calls Deno.upgradeWebSocket, add SETTINGS_ENABLE_CONNECT_PROTOCOL=1 to the h2 SETTINGS frame. Accept an extended CONNECT with :protocol: websocket and route it through the same upgrade handler.

Or, if a runtime flag is preferred: expose an option on Deno.serve like { 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.