
Short answer: HTTP/3 does not go through an HTTP proxy, because it runs over QUIC, and QUIC runs over UDP. Most HTTP proxies, such as Burp Suite, are built on HTTP over TCP, so they never see it. To intercept HTTP/3 you need a proxy that can relay UDP and can act as a man in the middle for QUIC. After that, the work is about streams and header compression: the request is not text any more, it is bytes on a QUIC stream, compressed with QPACK.
In this post we intercept real HTTP/3 traffic from curl and from Microsoft Edge. Then we use a small lab server to look at every byte, so the QUIC and QPACK parts are easy to follow.
Table of contents
What changes with HTTP/3
Why your usual proxy setup does not work
Real traffic 1: curl
Real traffic 2: Browser traffic
The lab: seeing every byte
The hard part: the QPACK dynamic table
Replay: send your own HTTP/3 request
Limits to know
A note on the tool: raw traffic, not HTTP
This post uses InterceptSuite, so you should know what it is and what it is not. It is not built for HTTP. It is built for raw network traffic: TCP, TLS, UDP, DTLS and QUIC. Because it can intercept UDP and QUIC, it can handle HTTP/3 too. But it does not come with an HTTP parser, and that is also true for HTTP/3. The core shows raw bytes.
To read and edit those bytes as HTTP, InterceptSuite has an extension API, and there is an official, open source HTTP/3 extension that decodes the QUIC stream and QPACK headers into text. You can read the code, change it, or send a fix. The decoding in the screenshots below comes from that extension, not from the core.
What changes with HTTP/3
If you have only used HTTP/1.1 or HTTP/2, three things are different.
1. It runs on QUIC, not TCP. HTTP/3 (RFC 9114) is HTTP carried over QUIC (RFC 9000). QUIC packets travel inside UDP datagrams. TLS 1.3 is part of the QUIC handshake (RFC 9001), so there is no separate "TCP then TLS" step.
2. The client has to learn that the server speaks HTTP/3. The ALPN name for HTTP/3 is h3. A server can advertise it with an Alt-Svc response header, and a DNS HTTPS record can advertise it too (RFC 9460). So a browser often makes its first request over TCP, then moves to QUIC.
3. Everything is a stream. A QUIC connection carries many streams. The two lowest bits of a stream ID tell you what it is (RFC 9000, section 2.1):
Stream ID ends in
Meaning
0 (binary 00)
Client starts it, both sides can send
1 (binary 01)
Server starts it, both sides can send
2 (binary 10)
Client starts it, only the client sends
3 (binary 11)
Server starts it, only the server sends
In HTTP/3, every client-started two-way stream is one request and its response (stream 0, 4, 8 and so on). The one-way streams are for housekeeping: a control stream, and two QPACK streams. Their type is the first byte on the stream: 0x00 control, 0x02 QPACK encoder, 0x03 QPACK decoder (RFC 9114, section 6.2 and RFC 9204, section 4.2).
One more detail that matters for interception. The first packets of a QUIC connection (the Initial packets) are protected with keys that anyone can calculate from the connection ID, so they have no real secrecy (RFC 9001, section 5). That is why a passive observer can still see things like the server name in the handshake. Everything after the handshake is encrypted with keys from the TLS 1.3 exchange. You cannot read it without being one of the two ends. A proxy that wants to read HTTP/3 has to be one of the two ends.
Why your usual proxy setup does not work
HTTP proxies use CONNECT to open a tunnel. In HTTP/3, CONNECT still builds a tunnel to a TCP connection (RFC 9114, section 4.4). To tunnel UDP over HTTP there is a different method, CONNECT-UDP (RFC 9298), and most tools and apps do not use it.
SOCKS5 can relay UDP. The command is UDP ASSOCIATE (RFC 1928). But many clients never use it. For example, the Chromium network docs say that in Chrome, SOCKSv5 is only used to proxy TCP-based requests and cannot relay UDP (Chromium proxy docs). So pointing a browser at a SOCKS5 proxy does not send its QUIC traffic through that proxy, and you are not testing the QUIC path.
That leaves two practical ways to get QUIC traffic into a proxy:
The app (or a library) speaks SOCKS5 UDP itself. The lab client later in this post does this, so you can see exactly what the proxy receives.
You redirect the app's traffic from outside the app, so it does not need to know about the proxy. This is what we use for curl and Edge. ProxyBridge does this on its own. InterceptSuite also has a Redirect tab, which is built on ProxyBridge and works inside the app.
For how this compares with mitmproxy, see the QUIC interception post.
Setup: the Redirect tab
Open Proxy, then Redirect, click Add, type the program name (for example curl.exe), leave the action on Proxy, and save. Then click Start Redirect. The status line says Redirecting through the proxy at 127.0.0.1:4444, and the program's TCP and UDP traffic goes through InterceptSuite without changing any setting in the program.
A rule can also limit the destination hosts and ports. The first matching rule decides, and programs that match no rule are left alone. Remember to trust the InterceptSuite CA on the machine, as in the quick start.
Real traffic 1: curl
curl is a good first test because it is simple and does exactly what you tell it. It needs a build with HTTP/3 support. This example runs on Windows. The curl that ships with Windows (8.21.0 here) does not support HTTP/3: curl -V does not list HTTP3 in its features. So we installed a second curl build that does:
winget install cURL.cURL
The new build (8.23.0) lists HTTP3, ngtcp2 and nghttp3 in curl -V. Check yours the same way before you test, and make sure the new curl is the one that runs (open a new terminal after the install).
curl --http3-only -sS -D - https://cloudflare-quic.com/cdn-cgi/trace
--http3-only makes curl use HTTP/3 and nothing else, so it cannot quietly fall back to TCP. With the Redirect rule on, curl worked without any proxy option and its output showed HTTP/3 200. No -k was needed, because curl used the Windows trust store, where the InterceptSuite CA is installed.
In Proxy History the connection appeared as QUIC with host cloudflare-quic.com and ALPN h3:
The first client packet (46 bytes) is the request. With the HTTP/3 tab it reads like this:
Now turn Intercept ON, run curl again, and change the request while it is held. Replace user-agent: curl/8.23.0 with user-agent: edited-by-proxy and press Forward:
The test site prints back what it saw. The first run says uag=curl/8.23.0. The run with the edit says:
uag=edited-by-proxy
So the server got the edited header, and curl never knew. The response is readable too:
Look at curl's SETTINGS frame, from the client:
QPACK_MAX_TABLE_CAPACITY: 0 means curl does not use the QPACK dynamic table at all. That is why every curl request is easy to read and edit. We will see the opposite case later.
Real traffic 2: Browser traffic
Browsers are harder, for two reasons.
ECH (Encrypted Client Hello). The real site name is hidden inside the handshake. The proxy only sees the CDN's public name, so it makes a certificate for the wrong name and the browser rejects it.
Chromium does not run QUIC with a locally added CA. Even when Windows trusts the CA, Chromium refuses QUIC on a certificate that chains to a user-installed CA.
The fix is to start the browser with three flags:
msedge.exe --disable-features=EncryptedClientHello,UseDnsHttpsSvcb
--ignore-certificate-errors-spki-list=<hash>
--origin-to-force-quic-on=*
--disable-features=... turns off ECH and stops the browser from reading HTTPS DNS records, where the ECH keys come from.
--origin-to-force-quic-on=* makes Edge try QUIC straight away, instead of waiting for an Alt-Svc header. * means every host. Use host:443 for one site.
--ignore-certificate-errors-spki-list=<hash> trusts QUIC connections signed by the InterceptSuite CA. Use this flag and not --ignore-certificate-errors.
<hash> is the base64 SHA-256 of the CA's public key. You calculate it from your own CA file:
openssl x509 -in intercept-ca.pem -pubkey -noout | openssl pkey -pubin -outform der | openssl dgst -sha256 -binary | openssl enc -base64
Edge shows a bar saying the flag is unsupported. That is expected, and it is why you should use a test profile and not your daily one. Close all Edge windows before you start it, or the flags are ignored.
With the Redirect rule for msedge.exe on, open https://cloudflare-quic.com/. The page says "your browser used HTTP/3":
In InterceptSuite the same visit was a QUIC connection with ALPN h3. The request from Edge, decoded by the extension:
And the response, with the alt-svc: h3=":443" header the site uses to advertise HTTP/3:
The response body here is content-encoding: gzip. The extension decompresses it for display, so the body shows as HTML.
Edge's SETTINGS are very different from curl's:
Edge offers a 64 KB dynamic table and up to 100 blocked streams, so after the first request, Edge can send headers as table references. The QPACK section below explains what that means for reading and editing.
How SOCKS5 carries UDP
UDP ASSOCIATE works in two parts.
The client opens a normal TCP connection to the proxy, does the SOCKS5 greeting, and sends the command 03 (UDP ASSOCIATE). The proxy answers with an address and a port. This is the UDP relay.
The client sends UDP datagrams to that relay address. Each datagram starts with a small header, then the real payload.
The header, from RFC 1928 section 7:
RSV (2 bytes) | FRAG (1) | ATYP (1) | DST.ADDR (variable) | DST.PORT (2) | DATA
The association lives as long as the TCP connection that asked for it. If that TCP connection closes, the UDP association ends (RFC 1928, section 6). This is easy to forget when you write your own client.
InterceptSuite listens on 127.0.0.1:4444 for SOCKS5 over TCP and 127.0.0.1:4445 for the UDP relay (see the quick start). The reply to UDP ASSOCIATE points to 127.0.0.1:4445.
The lab: seeing every byte
Real servers make it hard to see what is going on, so here is a small lab. Both sides use Python and aioquic.
Server: a small HTTP/3 server on 127.0.0.1:4433 with a self-signed certificate. It answers with JSON that repeats what it received (method, path, one custom header, and the body). It also prints what it got, so you can see what actually arrived.
Client: an HTTP/3 client that sends its datagrams through the SOCKS5 UDP relay. aioquic does not know about SOCKS5, so the client wraps its datagrams itself. This is the whole trick:
class Shim(asyncio.DatagramProtocol):
"""Wraps each QUIC datagram in the SOCKS5 UDP header."""
def sendto(self, data, addr=None):
hdr = b'\x00\x00\x00\x01' + socket.inet_aton(SERVER[0]) + struct.pack('!H', SERVER[1])
self.t.sendto(hdr + data, self.relay)
def datagram_received(self, d, addr):
if d[0:3] != b'\x00\x00\x00' or d[3] != 1:
return
self.proto.datagram_received(d[10:], SERVER) # strip the 10 byte header
The lab client skips certificate checks. That is fine for a lab. A real app must trust the proxy's CA certificate, or it will close the connection when it sees the forged certificate. See Install the CA certificate for that step.
The lab client sent one request:
POST /login (body: user=alice&pw=hunter2)
user-agent: h3-lab-client/1.0
accept: application/json
authorization: Bearer eyJhbGciOiJIUzI1NiJ9.demo.token
cookie: session=abc123def456; theme=dark
x-demo: first
What the proxy sees: ten rows for one request
Here is Proxy History after the client connected, sent requests, and closed.
The host column shows h3.lab.test. That is the server name from the TLS handshake. The ALPN column shows h3. The Protocol column says QUIC.
The thing most people do not expect is the number of rows. One request gave 10 entries, not 2. Each row is a chunk of data from one QUIC stream, in the order the proxy saw it. The small ones are all HTTP/3 housekeeping:
Direction
Size
Bytes
What it is
Both ways
1
03
Stream type byte:
Texto de interceptsuite.com tal como lo publicó, leído de su página y mostrado aquí con el formato de El Autómata. El original, en interceptsuite.com · Volver a la noticia de El Autómata