Skip to content

Commit a4786af

Browse files
kixelatedclaude
andauthored
Add qmux crate and deprecate web-transport-ws (#191)
* Add qmux crate and deprecate web-transport-ws Implement the QMux protocol (draft-ietf-quic-qmux-00) as a new crate supporting multiplexing over TCP, TLS (feature-gated), and WebSocket (feature-gated). The wire format is backwards-compatible with the legacy webtransport encoding used by web-transport-ws. The web-transport-ws Rust side is now a thin stub re-exporting from qmux. The TypeScript polyfill is updated to support both webtransport and qmux-00 wire formats via version-aware encode/decode. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Restructure qmux into feature-gated transport modules Replace the monolithic Client/Server with feature-gated modules: - qmux::tcp (feature = "tcp", default) — connect/accept functions - qmux::tls (feature = "tls") — connect/accept with rustls - qmux::ws (feature = "ws") — Client/Server builders + connect/accept for pre-upgraded WebSockets - qmux::wss (feature = "wss") — WebSocket over TLS (rustls) TCP is now also feature-gated for potential no-std use. Core session/frame/stream types are always available. Also addresses review feedback: fix hardcoded SNI "localhost", consume DATAGRAM/QX_TRANSPORT_PARAMETERS payloads in decode, replace todo!() panics with DatagramsUnsupported error, use expect instead of unwrap_or for post-handshake invariant, accept bare qmux-00 unconditionally, make frame types pub(crate), return errors instead of panicking on malformed VarInt/unsupported version. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Add public proto module with wire format types and Transport trait Move frame encoding/decoding and version types into a public `proto` module. Rename FrameTransport to Transport and make Session::new() public so users can implement custom transports. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Fix review findings: negotiation, error handling, and shim correctness - Guard bare ALPN fallbacks in Server::accept with supported.is_empty() - Return error from parse_negotiated_protocol on unrecognized headers - Preserve tungstenite error details via Error::Io instead of Error::Closed - Fix RecvStream::closed() to poll both channels when buffer is non-empty - Error on lengthless DATAGRAM (0x30) over byte streams - Remove duplicate constants in ws.rs, use crate-level imports - Fix web-transport-ws shim: disable default features, forward wss feature - Fix README migration snippet with correct qmux::ws imports Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Add cancellation safety warning to SessionState::run Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Improve public API: ALPNS const, Session::connect/accept, docstrings - Replace individual ALPN_*/PREFIX_* public consts with ALPNS and PREFIXES slices so callers auto-support new versions - Add Session::connect/accept, make Session::new private - Enable all features by default (tls + wss) - Add docstrings to all public types, traits, and methods - Bump web-transport-ws to 0.4.0 (breaking: shim removed API surface) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Fix clippy single_match warning in session loop Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Fix wss feature conflict, error handling, and docs - Add qmux wss-webpki-roots feature to avoid pulling in both root stores - Fix web-transport-ws to use wss-webpki-roots for its webpki feature - Preserve error details in ws::Client::connect instead of mapping to Closed - Add comment explaining QX_TRANSPORT_PARAMETERS magic constant - Simplify README migration diff to show only changed imports Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Remove wss-webpki-roots feature, drop webpki feature from shim The deprecated web-transport-ws shim is the only consumer; new users should use qmux directly and configure TLS roots themselves. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Split wss into wss-native-roots and wss-webpki-roots Default to tls + ws without any root certificates, so server-only usage doesn't pull in unnecessary root stores. Clients opt into whichever root store they need. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Simplify TLS features: single wss with rustls native roots No need for native-tls or webpki-roots variants — qmux already uses rustls for TCP/TLS, so one wss feature with native roots keeps it simple. Back in the default features. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Move TypeScript code from web-transport-ws to qmux, publish as @moq/qmux - Move all TS source (session, frame, stream, varint) to qmux/ - Add package.json, tsconfig.json, build/release scripts to qmux/ - Stub web-transport-ws to re-export from @moq/qmux (deprecated) - Remove deprecated Rust examples from web-transport-ws - Add pnpm-workspace.yaml for workspace resolution Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Re-export tungstenite and tokio_tungstenite from qmux, bump to 0.0.2 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * More qmux changes. * Send QX_TRANSPORT_PARAMETERS on qmux-00 WebSocket connections The qmux spec requires this as the first frame. Without it, servers reject the connection immediately. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Rename WebTransportWs * PR improvements. * fmt --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 37cf81d commit a4786af

44 files changed

Lines changed: 5339 additions & 1444 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[workspace]
22
members = [
3+
"qmux",
34
"web-transport",
45
"web-transport-noq",
56
"web-transport-proto",

bun.lock

Lines changed: 18 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"private": true,
44
"type": "module",
55
"workspaces": [
6+
"qmux",
67
"web-demo",
78
"web-transport-ws"
89
],

0 commit comments

Comments
 (0)