Skip to content

Tests: add forward proxy and CONNECT tunnel coverage#39

Open
anchmelev wants to merge 3 commits into
nginx:masterfrom
anchmelev:issue-1140-forward-proxy
Open

Tests: add forward proxy and CONNECT tunnel coverage#39
anchmelev wants to merge 3 commits into
nginx:masterfrom
anchmelev:issue-1140-forward-proxy

Conversation

@anchmelev
Copy link
Copy Markdown

@anchmelev anchmelev commented Mar 25, 2026

This adds companion test coverage for OSS forward proxy support and CONNECT tunneling.

The new tests cover HTTP/1.1, HTTP/2, and HTTP/3 behavior for both CONNECT tunnels and ordinary HTTP forward proxying.

Added tests

CONNECT tunnel coverage

  • tunnel.t
  • h2_tunnel.t
  • h3_tunnel.t

These tests cover:

  • successful HTTP/1.1 CONNECT tunnel establishment
  • bidirectional relay
  • preread and pipelined client data
  • large payload transfer
  • tunnel_allow_upstream
  • retry vs no-retry behavior
  • resolver and no-resolver cases
  • unix socket tunnel upstreams
  • tunnel_bind / tunnel_bind_dynamic
  • HTTP/2 CONNECT
  • HTTP/3 CONNECT
  • rejection when tunnel support is not configured
  • missing :authority handling for H2/H3 CONNECT

Forward proxy coverage

  • forward_proxy.t
  • forward_proxy_conf.t
  • forward_proxy_ipv6.t
  • h3_forward_proxy.t

These tests cover:

  • HTTP/1.1 absolute-form GET/HEAD/POST
  • rewrite to origin-form upstream requests
  • Host reconstruction from target authority
  • rejection of origin-form requests in forward proxy mode
  • rejection of https://... targets without CONNECT
  • rejection of CONNECT when only forward_proxy on; is configured
  • hostname targets resolved via resolver
  • no-resolver failure paths
  • IPv6 targets
  • HTTP/2 forward proxy behavior
  • HTTP/3 forward proxy behavior
  • configuration-time validation for forward_proxy and proxy_pass
  • inheritance and override cases for forward_proxy on/off

Harness update

lib/Test/Nginx.pm is updated to recognize the new http_tunnel module in feature checks.

Validation

This test set was run together with the corresponding nginx implementation changes, along with existing regression coverage for proxy and H2/H3 request body handling.

Companion implementation PR: nginx/nginx#1217

This PR adds companion tests for the OSS forward proxy support introduced in nginx/nginx#1217.

@anchmelev
Copy link
Copy Markdown
Author

I have hereby read the F5 CLA and agree to its terms

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant