curl/tests/http
Stefan Eissing 73daec6620
lib: transfer origin and proxy handling
Add `data->state.origin` as the origin the transfer is sending the
current request to/gets the response from. Use it for request specific
properties like authentication, hsts and cookie handling, etc.

Unless talking to a forwarding HTTP proxy (e.g. not tunneling),
`data->state.origin` and `conn->origin` are the same.

With a forwarding HTTP proxy in play, `conn->origin` is set to
`conn->http_proxy.peer` and `conn->bits.origin_is_proxy` (a new bit) is
set.

Remove the connection bits, now replaced with:

* `conn->bits.socksproxy` -> `conn->socks_proy.peer`
* `conn->bits.httpproxy` -> `conn->http_proy.peer`
* `conn->bits.proxy` -> `(conn->socks_proy.peer || conn->http_proy.peer`)
* `conn->bits.tunnel_proxy` -> (`conn->http_proy.peer && !conn->bits.origin_is_proxy`)
* `(conn->bits.httpproxy && !conn->bits.tunnel_proxy)` -> `conn->bits.origin_is_proxy`

Rename `noproxy.[ch]` to `proxy.[ch]`. Move the connection proxy setup
code from `url.c` to `proxy.c`.

Remove `data->info.conn_remote_port` as no one uses it.

Add test_40_02b for a SOCKS connection to a forwarding HTTPS proxy.

Update internal documentation about peers and creds.

Closes #21967
2026-06-12 23:52:00 +02:00
..
testenv pytest: use Optional[], adjust whitespace 2026-06-09 13:24:09 +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 h3-proxy: fixes around H3 proxy 2026-05-28 14:41:27 +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 scorecard: add support for http: testing 2026-05-31 16:58:11 +02: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 pytest: close file handles after use, and two minor tidy-ups 2026-06-09 02:05:21 +02: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 tidy-up: miscellaneous 2026-06-09 11:07:55 +02:00
test_06_eyeballs.py ngtcp2: share common functionality 2026-06-10 13:28:05 +02:00
test_07_upload.py pytest: close file handles after use, and two minor tidy-ups 2026-06-09 02:05:21 +02:00
test_08_caddy.py pytest: close file handles after use, and two minor tidy-ups 2026-06-09 02:05:21 +02:00
test_09_push.py tidy-up: add space around operators, where missing 2026-05-28 10:12:00 +02:00
test_10_proxy.py pytest: close file handles after use, and two minor tidy-ups 2026-06-09 02:05:21 +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 pytest: close file handles after use, and two minor tidy-ups 2026-06-09 02:05:21 +02:00
test_14_auth.py tidy-up: miscellaneous 2026-06-01 22:33:57 +02: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 tidy-up: add space around operators, where missing 2026-05-28 10:12:00 +02:00
test_17_ssl_use.py pytest: close file handles after use, and two minor tidy-ups 2026-06-09 02:05:21 +02:00
test_18_methods.py tidy-up: add space around operators, where missing 2026-05-28 10:12:00 +02:00
test_19_shutdown.py tidy-up: add space around operators, where missing 2026-05-28 10:12:00 +02:00
test_20_websockets.py pytest: fix remaining code checker warnings 2026-06-09 12:30:16 +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 pytest: close file handles after use, and two minor tidy-ups 2026-06-09 02:05:21 +02:00
test_31_vsftpds.py pytest: close file handles after use, and two minor tidy-ups 2026-06-09 02:05:21 +02:00
test_32_ftps_vsftpd.py pytest: close file handles after use, and two minor tidy-ups 2026-06-09 02:05:21 +02:00
test_40_socks.py lib: transfer origin and proxy handling 2026-06-12 23:52:00 +02:00
test_50_scp.py pytest: close file handles after use, and two minor tidy-ups 2026-06-09 02:05:21 +02:00
test_51_sftp.py pytest: close file handles after use, and two minor tidy-ups 2026-06-09 02:05:21 +02:00
test_60_h3_proxy.py tidy-up: miscellaneous 2026-06-01 22:33:57 +02:00