Repository navigation
spike(proxy): CONNECT-UDP (RFC 9298) capability in fleet-proxy, default off (#6109) - #6114
Merged
Merged
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 40 minutes. View limit details
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. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Nov 5, 2026
Closed
This was referenced Nov 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Spike for #6109. Capability only — no cutover. Drew's call (2026-11-05): spike CONNECT-UDP so the capability exists at minimum; enabling it anywhere needs his separate word. The #5924 verdict (Moonlight streaming = tailnet-direct) is unchanged.
Step-0 finding: who owns CONNECT in the path
The only HTTP CONNECT proxy server in the sandbox→laptop path is the Muse runtime's egress proxy (
hatch-egress-proxy:3130, named by$HTTPS_PROXY) — not ours to modify. Our components are CONNECT clients:fleet-proxy's broker pools CONNECT tunnels through that runtime proxy (tunnel.rsmodule doc), and proxy-supervisor's relay CONNECTs through it too. So the spike lands in our fleet proxy component,pkgs/fleet/crates/fleet-proxy, built so fleet traffic could terminate at our own code later.What this adds
crates/fleet-proxy/src/connect_udp.rs(new, behind the existingservefeature): an RFC 9298 CONNECT-UDP endpoint —CONNECT-UDP /.well-known/masque/udp/{host}/{port}/+Capsule-Protocol: ?1, RFC 9297 capsule framing, context ID 0 (raw UDP payload), one connected UDP socket per session (only the target's packets relay back), 120 s idle close. Two behaviors pinned by tests because they decide whether a media target survives real life: a target's ICMP port-unreachable is treated as UDP weather, not session death (a restarting target finds the relay still standing), and unknown capsules are skipped per RFC 9297.fleet-config):[proxy] connect_udp(default false) andconnect_udp_listen(default127.0.0.1:3131, loopback).fleet proxy servespawns the listener only when enabled; a bind failure logs and the broker carries on. With the flag off — every current config — the broker is byte-for-byte the old behavior.examples/connect_udp_proof.rs: the burst-proof harness (below).UdpProxyClient(+ split sender/receiver halves) exists to prove the server half; it is test tooling, not a product client.No target allowlist, deliberately: the listener is loopback-only and off by default, the broker's own trust posture. A cutover that binds it wider owes an explicit target policy — stated in the module doc so the gap is a decision on record.
Carrier: HTTP/1.1 + capsules (TCP), and what that costs
The crate is hand-rolled std-only Rust with a hand-rolled HTTP/1.1 stack; HTTP/3 + QUIC DATAGRAM would mean importing a QUIC stack this component deliberately doesn't carry. So the spike carrier is RFC 9298 over HTTP/1.1: datagrams ride the TCP connection. That inherits TCP ordering/head-of-line blocking — on a lossy wire, loss becomes retransmit latency instead of drops. It is the wrong trade for media and the right trade for a capability proof. The media carrier (H3 + QUIC DATAGRAM, unreliable, no HoL) is follow-up work if cutover is ever called for.
Proof (acceptance gate)
cargo test -p fleet-config -p fleet-proxy-proto -p fleet-proxy: 14 + 42 + 10 passed — the full existing broker/tunnel/http suites are the TCP-CONNECT regression gate, plus new tests (varint/capsule codecs, split-feed parsing, refusal handshakes, windowed 300×1200 B relay burst, dead-target session survival). Connect-only variant (--no-default-features) also compiles.Burst proof,
cargo run -p fleet-proxy --example connect_udp_proof— 1200-byte datagrams at ~90/s for 30 s (2700 datagrams each way) to a loopback UDP echo, two runs, debug build:Added latency at p50: +0.08…0.12 ms. Caveat, stated plainly: loopback is the flattering environment for a TCP carrier — no wire loss exists to convert into HoL stalls. These numbers prove the relay is correct and cheap; they do not prove the TCP carrier is media-grade on a real network. That proof belongs to the H3 follow-up, if any.
How a real client would use it later (the remaining cutover work)
UdpProxyClientproves the protocol half; the shim is the product half.)fleet proxy serveon the laptop with[proxy] connect_udp = true, reached over the tailnet. Note this only becomes interesting if a future topology has a hop the tailnet can't do directly; today tailnet-direct already wins, which is why this is capability, not cutover.What is explicitly NOT done
Closes #6109 (the spike ask; cutover remains a separate, unstarted decision).
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.