moq-net: map MoQ versions to required qmux versions#1513
Conversation
The MoQ WG decided qmux's draft version is tied to the moq-transport version. moq-transport-18 requires qmux-01; moq-transport-14..17 stay on qmux-00. moq-lite is unconstrained: existing Lite01..Lite04 advertise both for back-compat, and future moq-lite versions should pin to a single qmux version like moq-transport does. Add a local QmuxVersion enum, Version::qmux_versions (the spec mapping), Version::accepts_qmux (server-side validation), and Versions::qmux_alpns (ordered, dedup'd (qmux_version, app_alpn) pairs for building the Sec-WebSocket-Protocol list). Lite arms are listed by variant rather than wildcard so adding a new Lite variant fails to compile until someone makes a deliberate choice. Wiring through moq-native (and the qmux 0.0.8 bump) follows in a separate change once upstream PR moq-dev/web-transport#226 lands and exposes an API for explicit (version, protocol) pairs instead of the default cross-product. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThis PR introduces qmux version support to the MoQ protocol library. A new QmuxVersion enum represents qmux draft versions (00 and 01). Version gains qmux_versions() and accepts_qmux() to enumerate and validate allowed qmux drafts per MoQ version. Versions::qmux_alpns() builds deduplicated (QmuxVersion, app_alpn) advertisement pairs for WebSocket/TLS fronting. Unit tests validate the mappings, acceptance checks, exact ALPN pair tables, and QmuxVersion ALPN strings. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
CI's rustfmt collapses single-expr match arms; local fmt didn't flag it. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
moq-net:QmuxVersionenum,Version::qmux_versions,Version::accepts_qmux, andVersions::qmux_alpns(ordered dedup'd(qmux_version, app_alpn)pairs for building theSec-WebSocket-Protocollist).Why this lives in moq-net
The composition of
(qmux_version, app_alpn)pairs is policy that depends on the moq-transport spec, not on qmux. qmux today (0.0.7) and after moq-dev/web-transport#226 cross-products qmux versions × app protocols internally, which would advertise illegal pairs likeqmux-00.moqt-18orqmux-01.moqt-17. Keeping the mapping here meansmoq-nativecan build exactly the right pairs and feed them through whatever opaque-protocol path qmux exposes (or, if needed, prompt a smallwith_raw_protocolsaddition upstream).What's not in this PR
moq-native's websocket client/server andmoq-relay's sub-protocol list. That's blocked on the qmux 0.0.8 release that ships PR 226 with an API for explicit pairs.qmuxworkspace dep from0.0.7.Test plan
cargo test -p moq-net --lib version::— 7 new tests pinning the table and per-version mappings, plus the unchanged 327 existing tests, all pass.cargo clippy -p moq-net --all-targets -- -D warningsclean.cargo fmt -p moq-net -- --checkclean.cargo build -p moq-native -p moq-relay -p moq-cli— downstream crates still compile against the new surface (it's purely additive).(Written by Claude)