curl/tests/http
Aritra Basu e78b1b3ecc
HTTP/3: add proxy CONNECT and MASQUE CONNECT-UDP support (ngtcp2 QUIC)
This patch adds two major proxy capabilities to curl (ngtcp2 QUIC):
- HTTP/3 Proxy CONNECT: Tunnel HTTP/1.1 or HTTP/2 traffic through an
  HTTPS proxy that speaks HTTP/3 (QUIC) using the standard CONNECT
  method over an HTTP/3 connection.
- MASQUE CONNECT-UDP: Tunnel HTTP/3 (QUIC) traffic through an HTTP
  proxy (speaking HTTP/1.1, HTTP/2, or HTTP/3) using the extended
  CONNECT method with the CONNECT-UDP protocol (RFC9297 & RFC9298).

Public API additions:
- `CURLPROXY_HTTPS3`: new proxy type constant for HTTP/3 proxy
- `--proxy-http3`: new CLI flag to negotiate HTTP/3 with HTTPS proxy

The implementation adds two new filters:
- `H3-PROXY` - enables negotiating HTTP/3 (QUIC) to the proxy and
  running CONNECT/CONNECT-UDP through that proxy transport.
- `CAPSULE` - dedicated filter inserted between QUIC transport and
  HTTP-PROXY to handle datagram capsule encapsulation/decapsulation.

Here is how the curl filter chaining looks in different scenarios:
- HTTP/3 Proxy CONNECT (tunneling TCP protocols over QUIC proxy):
  conn -> HTTP/1.1 or HTTP/2  -> SSL -> HTTP-PROXY ->
                                 H3-PROXY -> HAPPY-EYEBALLS -> UDP
- MASQUE CONNECT-UDP (tunneling QUIC over any proxy):
  conn -> HTTP/3 -> CAPSULE -> HTTP-PROXY -> H3-PROXY ->
                               HAPPY-EYEBALLS -> UDP
  conn -> HTTP/3 -> CAPSULE -> HTTP-PROXY -> H1-PROXY or H2-PROXY ->
                               SSL -> HAPPY-EYEBALLS -> TCP

- Both features currently require the ngtcp2 QUIC backend.
- Both features are experimental (disabled by default). Enable with
  `--enable-proxy-http3`(autotools) or `-DUSE_PROXY_HTTP3=ON`(CMake).

Tests:
- tests/unit/unit3400.c: Unit tests for capsule protocol encode/decode
- tests/http/test_60_h3_proxy.py: Comprehensive pytest integration suite
- tests/http/testenv/h2o.py: Managing h2o instances with HTTP/1.1, HTTP/2,
  and HTTP/3 (QUIC) listeners, proxy.connect and proxy.connect-udp enabled.

References:
  RFC 9297 - HTTP Datagrams and the Capsule Protocol
  RFC 9298 - Proxying UDP in HTTP
  RFC 9000 §16 — Variable-Length Integer Encoding

Signed-off-by: Aritra Basu <aritrbas+gh@cisco.com>

Closes #21153
2026-05-27 08:49:53 +02:00
..
testenv HTTP/3: add proxy CONNECT and MASQUE CONNECT-UDP support (ngtcp2 QUIC) 2026-05-27 08:49:53 +02:00
.gitignore tidy-up: mostly whitespace nits 2023-08-31 23:02:10 +00:00
CMakeLists.txt HTTP/3: add proxy CONNECT and MASQUE CONNECT-UDP support (ngtcp2 QUIC) 2026-05-27 08:49:53 +02:00
config.ini.in HTTP/3: add proxy CONNECT and MASQUE CONNECT-UDP support (ngtcp2 QUIC) 2026-05-27 08:49:53 +02:00
conftest.py HTTP/3: add proxy CONNECT and MASQUE CONNECT-UDP support (ngtcp2 QUIC) 2026-05-27 08:49:53 +02:00
Makefile.am HTTP/3: add proxy CONNECT and MASQUE CONNECT-UDP support (ngtcp2 QUIC) 2026-05-27 08:49:53 +02:00
requirements.txt GHA: bump actions and pips 2026-05-01 21:19:22 +02:00
scorecard.py tests: make whitespace between functions and classes consistent 2026-04-08 10:28:05 -07:00
test_01_basic.py tests: alphabetize and group Python imports & add check 2026-04-08 10:28:05 -07:00
test_02_download.py tests: alphabetize and group Python imports & add check 2026-04-08 10:28:05 -07:00
test_03_goaway.py tests: alphabetize and group Python imports & add check 2026-04-08 10:28:05 -07:00
test_04_stuttered.py tests: alphabetize and group Python imports & add check 2026-04-08 10:28:05 -07:00
test_05_errors.py quiche: bump cloudflare/quiche to v0.29.0, update pytest workaround 2026-05-24 14:16:38 +02:00
test_06_eyeballs.py dnsd: implement HTTPS-RR with alpn pref and no-default-alpn 2026-04-16 22:53:20 +02:00
test_07_upload.py pytest: switch off h3 for pytest_07_22 2026-04-10 12:39:51 +02:00
test_08_caddy.py tests: alphabetize and group Python imports & add check 2026-04-08 10:28:05 -07:00
test_09_push.py tests: alphabetize and group Python imports & add check 2026-04-08 10:28:05 -07:00
test_10_proxy.py tidy-up: miscellaneous 2026-05-20 00:50:43 +02:00
test_11_unix.py unix-sockets: ignore proxy settings 2026-05-16 18:49:46 +02:00
test_12_reuse.py tests: alphabetize and group Python imports & add check 2026-04-08 10:28:05 -07:00
test_13_proxy_auth.py tests: alphabetize and group Python imports & add check 2026-04-08 10:28:05 -07:00
test_14_auth.py tests: alphabetize and group Python imports & add check 2026-04-08 10:28:05 -07:00
test_15_tracing.py tests: alphabetize and group Python imports & add check 2026-04-08 10:28:05 -07:00
test_16_info.py tests: alphabetize and group Python imports & add check 2026-04-08 10:28:05 -07:00
test_17_ssl_use.py urlapi: deny hostnames with more than one trailing dot 2026-05-15 11:44:20 +02:00
test_18_methods.py tests: alphabetize and group Python imports & add check 2026-04-08 10:28:05 -07:00
test_19_shutdown.py tests: alphabetize and group Python imports & add check 2026-04-08 10:28:05 -07:00
test_20_websockets.py websockets: auto-tunnel through http proxy 2026-05-20 11:50:35 +02:00
test_21_resolve.py pythonlint.sh: make it fail on error, fix ruff warnings in pytest 2026-05-13 22:59:36 +02:00
test_22_httpsrr.py pythonlint.sh: make it fail on error, fix ruff warnings in pytest 2026-05-13 22:59:36 +02:00
test_30_vsftpd.py tests: alphabetize and group Python imports & add check 2026-04-08 10:28:05 -07:00
test_31_vsftpds.py tests: alphabetize and group Python imports & add check 2026-04-08 10:28:05 -07:00
test_32_ftps_vsftpd.py tests: alphabetize and group Python imports & add check 2026-04-08 10:28:05 -07:00
test_40_socks.py tests: alphabetize and group Python imports & add check 2026-04-08 10:28:05 -07:00
test_50_scp.py tests: alphabetize and group Python imports & add check 2026-04-08 10:28:05 -07:00
test_51_sftp.py tests: alphabetize and group Python imports & add check 2026-04-08 10:28:05 -07:00
test_60_h3_proxy.py HTTP/3: add proxy CONNECT and MASQUE CONNECT-UDP support (ngtcp2 QUIC) 2026-05-27 08:49:53 +02:00