diff --git a/test-integ/topoutil/asserter_blankspace.go b/test-integ/topoutil/asserter_blankspace.go index caba825783ef..65e617a1a8a0 100644 --- a/test-integ/topoutil/asserter_blankspace.go +++ b/test-integ/topoutil/asserter_blankspace.go @@ -64,12 +64,20 @@ func (a *Asserter) checkBlankspaceNameViaHTTPWithCallback( t.Helper() var ( - node = service.Node - addr = fmt.Sprintf("%s:%d", node.LocalAddress(), service.PortOrDefault(upstream.PortName)) - client = a.mustGetHTTPClient(t, node.Cluster) + node = service.Node + internalPort = service.PortOrDefault(upstream.PortName) + addr = fmt.Sprintf("%s:%d", node.LocalAddress(), internalPort) + client = a.mustGetHTTPClient(t, node.Cluster) ) if useHTTP2 { + // We can't use the forward proxy for http2, so use the exposed port on localhost instead. + exposedPort := node.ExposedPort(internalPort) + require.True(t, exposedPort > 0) + + addr = fmt.Sprintf("%s:%d", "127.0.0.1", exposedPort) + + // This will clear the proxy field on the transport. client = EnableHTTP2(client) } diff --git a/test-integ/topoutil/http2.go b/test-integ/topoutil/http2.go index 136d3d3cdc3c..148074e5638f 100644 --- a/test-integ/topoutil/http2.go +++ b/test-integ/topoutil/http2.go @@ -14,6 +14,9 @@ import ( // EnableHTTP2 returns a new shallow copy of client that has been tweaked to do // h2c (cleartext http2). +// +// Note that this clears the Client.Transport.Proxy trick because http2 and +// http proxies are incompatible currently in Go. func EnableHTTP2(client *http.Client) *http.Client { // Shallow copy, and swap the transport client2 := *client