moq-native: advertise QUIC preferred_address in the server config#1512
Conversation
Expose preferred_v4 and preferred_v6 on ServerConfig and plumb them into
quinn::ServerConfig::preferred_address_v{4,6}. Lets deployments handshake
on an anycast IP and migrate clients to a per-host unicast IP, so existing
connections survive BGP reconvergence and an overloaded host can withdraw
the anycast route without dropping anyone. Only the Quinn backend honors
the parameter; supporting clients today are Chrome M131+ and native Quinn.
Both fields are Option-typed so the TOML to CLI merge in moq-relay does
not clobber a TOML-configured value with Default::default() when the flag
is absent. New regression test in rs/moq-relay/src/config.rs guards that.
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 (3)
WalkthroughThis PR adds support for configuring QUIC's 🚥 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
Warning Review ran into problems🔥 ProblemsStopped waiting for pipeline failures after 30000ms. One of your pipelines takes longer than our 30000ms fetch window to run, so review may not consider pipeline-failure results for inline comments if any failures occurred after the fetch window. Increase the timeout if you want to wait longer or run a 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 |
Summary
preferred_v4: Option<SocketAddrV4>andpreferred_v6: Option<SocketAddrV6>tomoq_native::ServerConfig, exposed via CLI (--server-preferred-v{4,6}), env (MOQ_SERVER_PREFERRED_V{4,6}), and TOML ([server] preferred_v{4,6} = "...").quinn::ServerConfig::preferred_address_v{4,6}insideQuinnServer::new. Quinn handles CID allocation, reset-token generation, and transport-parameter packing.cli_does_not_clobber_toml_preferred_addressesregression test inrs/moq-relay/src/config.rsto guard the TOML-to-CLI merge behavior documented inCLAUDE.md.Why
The QUIC
preferred_addresstransport parameter (RFC 9000 §9.6) lets a server advertise an alternate address that the client migrates to shortly after the handshake. This unlocks a clean BGP anycast deployment shape:/24(handshake target).preferred_address.Supporting clients today: Chrome M131+ (on by default since November 2024, ~99% migration success per Google's measurements) and any native Quinn client (
moq-cli,moq-ffi-based iOS/Android/Swift/Kotlin). Firefox via neqo has the implementation but I could not confirm the glue layer wires it through; Safari has no public confirmation.Out of scope
noqandquichebackends do not expose this API. If either field is set, those backends will silently ignore it. Same shape as the existingtls.root(mTLS) flag, which is also Quinn-only.Test plan
just checkpasses (clippy, tests, docs, shear, sort, remark).cli_does_not_clobber_toml_preferred_addressespasses.moq-relay --server-bind '[::]:4443' --server-preferred-v4 127.0.0.2:4444against a loopback alias, connect withmoq-cli, capture withtshark -d udp.port==4443,quic -Vand confirm the handshake transport parameters contain the preferred address and the client sends aPATH_CHALLENGEto it.(Written by Claude)