MCPcopy
hub / github.com/caddyserver/caddy / TestProxyProtocolV2WithH2C

Function TestProxyProtocolV2WithH2C

caddytest/integration/proxyprotocol_test.go:404–406  ·  view source on GitHub ↗

TestProxyProtocolV2WithH2C verifies that PROXY protocol v2 headers are sent correctly when the transport uses h2c (HTTP/2 cleartext) to the upstream. This is the primary regression test for github.com/caddyserver/caddy/issues/7529: before the fix, the h2 transport opened a new TCP connection per req

(t *testing.T)

Source from the content-addressed store, hash-verified

402// (because req.URL.Host was mangled differently for each request due to the
403// varying client port), which caused file-descriptor exhaustion under load.
404func TestProxyProtocolV2WithH2C(t *testing.T) {
405 testProxyProtocolMatrix(t, "v2", []string{"h2c"}, 1)
406}
407
408// TestProxyProtocolV2WithH2CMultipleRequests sends several sequential requests
409// through the h2c + PROXY-protocol path and confirms that:

Callers

nothing calls this directly

Calls 1

testProxyProtocolMatrixFunction · 0.85

Tested by

no test coverage detected