From 869cfa094dd462025fa17ecf369cc1fd0461fd17 Mon Sep 17 00:00:00 2001 From: Hank Shen Date: Sat, 12 Nov 2022 12:20:26 +0800 Subject: [PATCH] update --- proxy.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/proxy.go b/proxy.go index 4c12c7b..9b40bf2 100644 --- a/proxy.go +++ b/proxy.go @@ -80,9 +80,12 @@ func (this *Proxy) Listen() error { this.ReserveProxy = &reverseproxy.NativeReverseProxy{PassingBrowsingURL: true} engine = `Standard` } - + listenAddr := this.Port + if !strings.Contains(listenAddr, `:`) { + listenAddr = `:` + listenAddr + } config := reverseproxy.ReverseProxyConfig{ - Listen: `:` + this.Port, + Listen: listenAddr, Router: router, RequestIDHeader: "X-Request-ID", ResponseBefore: func(ctx reverseproxy.Context) bool {