From c61c106542ae4122877c4435a1f86e589240e625 Mon Sep 17 00:00:00 2001 From: Aoang Date: Fri, 18 Feb 2022 14:48:57 +0800 Subject: [PATCH] Fix http proxy behavior Add Host header fix behavior https://datatracker.ietf.org/doc/html/rfc7230#section-5.4 --- fasthttpproxy/http.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fasthttpproxy/http.go b/fasthttpproxy/http.go index 6bc9c1e5b3..2d918135f2 100644 --- a/fasthttpproxy/http.go +++ b/fasthttpproxy/http.go @@ -49,7 +49,7 @@ func FasthttpHTTPDialerTimeout(proxy string, timeout time.Duration) fasthttp.Dia return nil, err } - req := "CONNECT " + addr + " HTTP/1.1\r\n" + req := fmt.Sprintf("CONNECT %s HTTP/1.1\r\nHost: %s\r\n", addr, addr) if auth != "" { req += "Proxy-Authorization: Basic " + auth + "\r\n" }