You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support HTTP/3 through an HTTP(S) upstream proxy (CONNECT-UDP / MASQUE) #8633
When a server connection is routed through an HTTP(S) upstream proxy, get_connection wraps the server layer in HttpUpstreamProxy (mitmproxy/proxy/layers/http/__init__.py:1124-1152), which opens a TCP CONNECT tunnel (mitmproxy/proxy/layers/http/_upstream_proxy.py:19-50). If the server layer is a QUIC/HTTP-3 layer (quic.ServerQuicLayer), the QUIC datagrams are written into that TCP tunnel. mitmproxy has no CONNECT-UDP (RFC 9298 / MASQUE) client, so HTTP/3 cannot be carried through an HTTP(S) upstream proxy.
For an addon this means routed HTTP/3 cannot work at all: today the only fail-closed option is to answer matched HTTP/3 flows with 502 before a server connection is made.
Steps to reproduce
Capture HTTP/3 (local redirect or WireGuard mode) and route it through an HTTP proxy with an addon:
with any HTTP proxy listening on 127.0.0.1:18080. The HTTP layer builds HttpUpstreamProxy around the QUIC server layer and sends a TCP CONNECT; the QUIC connection cannot use that tunnel. I verified the layer construction against the v12.3.1 source but did not run UDP capture end-to-end (it requires local mode or WireGuard).
Proposal
Implement CONNECT-UDP (RFC 9298) for HTTP/3 server connections whose server_conn.via points at an HTTP(S) upstream proxy.
If that is out of scope, fail routed HTTP/3 explicitly with a clear error and document that HTTP/3 is not routable through an HTTP(S) upstream proxy.
Additional context
Related: #8540 (support HTTP UDP MASQUE for HTTP/3), #7868 (forward WireGuard mode intercepts to an upstream proxy). A desktop UI built on mitmdump routes selected hosts through corporate HTTP proxies while capturing local/WireGuard traffic, including HTTP/3; today it has to fail matched HTTP/3 requests with 502.
Activity