This document describes the browser WebTransport path added for Phase 77.1.2. It covers the server-side HTTP/3 CONNECT flow, browser fallback behavior, and how Nexus envelopes map onto WebTransport streams and datagrams.
Server Flow#
Browser Selection#
Channel Mapping#
| Nexus reliability or message | WebTransport channel |
|---|---|
| Client reliable ordered commands | Bidirectional stream |
| Server snapshots and events | Server-initiated unidirectional stream |
| Unreliable sequenced state updates | WebTransport datagram |
| Browser without WebTransport support | WebSocket fallback |
Stream payloads use the same four-byte big-endian length prefix as the native
QUIC transport. Datagram payloads use the NXQD frame header with a version
byte, a big-endian sequence number, and a length-prefixed Nexus envelope.
Certificate Hash Pinning#
Development self-signed certificates are pinned by SHA-256 leaf certificate
hash. The Rust server helper derives the pin from the QUIC certificate bundle;
the TypeScript SDK normalizes the same 32-byte hash into the browser
serverCertificateHashes option.
Production deployments should rely on ACME-managed certificates and can leave the development hash list empty.
Metrics#
The WebTransport server reports RTT, packet loss, datagram drop ratio, queued
server-push depth, fallback activations, and in-flight bytes. These values are
converted into NexusSessionBandwidthMetrics for the existing connection
quality monitoring and bandwidth adaptation systems.