Add HTTP/3 proxying (UDP)#530
Open
Manouchehri wants to merge 1 commit into
Open
Conversation
Feature: add CONNECT-UDP (MASQUE / RFC 9298) proxy backend
There was a problem hiding this comment.
Pull request overview
This PR adds UDP proxying via HTTP/3 CONNECT-UDP (MASQUE / RFC 9298) and introduces a split-proxy configuration so TCP and UDP flows can be routed through different backends (required for UDP-only proxies like MASQUE).
Changes:
- Add a MASQUE proxy client implementation (HTTP/3 + QUIC datagrams) with capsule draining and PacketConn adaptation.
- Add
proxy.Splitplus engine/CLI/YAML support for--tcp-proxy/--udp-proxyoverride configuration. - Add tests for MASQUE behavior and for the new split-proxy parsing/building logic.
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| proxy/split.go | New Proxy implementation that delegates TCP vs UDP dialing to different backends. |
| proxy/masque/masque.go | Core MASQUE (CONNECT-UDP) client, URL parsing, shared H3 connection management, and per-session stream setup. |
| proxy/masque/packetconn.go | Adapts an HTTP/3 RequestStream datagram API into a net.PacketConn with deadline support. |
| proxy/masque/capsule.go | Adds capsule draining to prevent stream flow-control stalls. |
| proxy/masque/masque_test.go | Adds integration-style loopback tests for MASQUE + auth + parsing behaviors. |
| engine/register.go | Registers the new masque proxy protocol via side-effect import. |
| engine/key.go | Adds YAML keys tcp-proxy and udp-proxy to support split configuration. |
| engine/parse.go | Adds buildProxy to resolve (proxy, tcp-proxy, udp-proxy) into a single proxy.Proxy (possibly proxy.Split). |
| engine/engine.go | Switches netstack initialization to use buildProxy; improves proxy config logging. |
| engine/parse_test.go | Adds tests for split-proxy parsing/building regression and validation cases. |
| main.go | Adds CLI flags --tcp-proxy and --udp-proxy. |
| go.mod | Adds dependencies for QUIC/HTTP3 MASQUE client and URI templates. |
| go.sum | Updates module sums for new dependencies. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Feature: add CONNECT-UDP (MASQUE / RFC 9298) proxy backend
Tested with:
Bright Data is the only provider I know of currently offering this, and they do filter out a ton of ports.