From fd79c187393e2df013851148401f5e4728bd4939 Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Tue, 30 Jul 2024 17:47:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=85=B3=E9=97=AD=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E6=97=B6=E9=BB=98=E8=AE=A4127.0.0..1=E7=9A=84IP=E7=BB=91?= =?UTF-8?q?=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- restagent/restagent.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/restagent/restagent.go b/restagent/restagent.go index 734cf30e..0ea6dcd5 100644 --- a/restagent/restagent.go +++ b/restagent/restagent.go @@ -251,7 +251,7 @@ func main() { // AMF上报的UE事件, 无前缀,暂时特殊处理 app.POST(event.UriUEEventAMF, event.PostUEEventFromAMF) - var listenLocalhost bool = false + // var listenLocalhost bool = false for _, rest := range conf.Rest { // ipv4 goroutines if rest.IPv4 != "" { @@ -262,16 +262,16 @@ func main() { go HttpListen(listen, app) } } - if rest.IPv4 != "0.0.0.0" && !listenLocalhost { - listenLocalhost = true - // 默认启动localhost侦听 - listenLocal := "127.0.0.1" + ":" + strconv.Itoa(int(rest.Port)) - if strings.ToLower(rest.Scheme) == "https" { - go HttpListenTLS(listenLocal, rest.CaFile, rest.CertFile, rest.KeyFile, rest.ClientAuthType, app) - } else { - go HttpListen(listenLocal, app) - } - } + // if rest.IPv4 != "0.0.0.0" && !listenLocalhost { + // listenLocalhost = true + // // 默认启动localhost侦听 + // listenLocal := "127.0.0.1" + ":" + strconv.Itoa(int(rest.Port)) + // if strings.ToLower(rest.Scheme) == "https" { + // go HttpListenTLS(listenLocal, rest.CaFile, rest.CertFile, rest.KeyFile, rest.ClientAuthType, app) + // } else { + // go HttpListen(listenLocal, app) + // } + // } // ipv6 goroutines if rest.IPv6 != "" { listenv6 := "[" + rest.IPv6 + "]" + ":" + strconv.Itoa(int(rest.Port))