diff --git a/relay/server/listener/ws/listener.go b/relay/server/listener/ws/listener.go index f2df4d1b9..1ad57d27a 100644 --- a/relay/server/listener/ws/listener.go +++ b/relay/server/listener/ws/listener.go @@ -96,5 +96,5 @@ func remoteAddr(r *http.Request) string { if r.Header.Get("X-Real-Ip") == "" || r.Header.Get("X-Real-Port") == "" { return r.RemoteAddr } - return r.Header.Get("X-Real-Ip") + ":" + r.Header.Get("X-Real-Port") + return fmt.Sprintf("%s:%s", r.Header.Get("X-Real-Ip"), r.Header.Get("X-Real-Port")) }