From f2e108f8e7040defc102adc0af149b5f63222954 Mon Sep 17 00:00:00 2001 From: bboysoul <31786046+bboysoulcn@users.noreply.github.com> Date: Tue, 29 Jun 2021 13:28:04 +0800 Subject: [PATCH] Update https.go --- server/proxy/https.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/proxy/https.go b/server/proxy/https.go index dde1c2d..b13421b 100644 --- a/server/proxy/https.go +++ b/server/proxy/https.go @@ -191,11 +191,11 @@ func buildMyHttpsRequest(hostName string, c net.Conn) *http.Request { r.URL = new(url.URL) r.URL.Scheme = "https" r.Host = hostName - logs.Trace("start make") r.Header = make(http.Header) - logs.Trace("start add header") - r.Header.Set("X-Forwarded-For", c.RemoteAddr().String()) - r.Header.Set("X-Real-IP", c.RemoteAddr().String()) + addr = c.RemoteAddr().String() + addr = strings.Split(addr, ":")[0] + r.Header.Set("X-Forwarded-For", addr) + r.Header.Set("X-Real-IP", addr) return r }