diff --git a/pkg/util/httpstream/spdy/roundtripper.go b/pkg/util/httpstream/spdy/roundtripper.go index 824be7691b0..8f1cf77d6ae 100644 --- a/pkg/util/httpstream/spdy/roundtripper.go +++ b/pkg/util/httpstream/spdy/roundtripper.go @@ -79,11 +79,14 @@ func (s *SpdyRoundTripper) dial(req *http.Request) (net.Conn, error) { return s.dialWithoutProxy(req.URL) } + // ensure we use a canonical host with proxyReq + targetHost := netutil.CanonicalAddr(req.URL) + // proxying logic adapted from http://blog.h6t.eu/post/74098062923/golang-websocket-with-http-proxy-support proxyReq := http.Request{ Method: "CONNECT", URL: &url.URL{}, - Host: req.URL.Host, + Host: targetHost, } proxyDialConn, err := s.dialWithoutProxy(proxyURL)