fix: localhost listen

This commit is contained in:
2023-12-20 17:25:08 +08:00
parent 684283d761
commit f607662032

View File

@@ -201,13 +201,10 @@ func main() {
if rest.IPv4 != "0.0.0.0" {
// 默认启动localhost侦听
listenLocal := "127.0.0.1" + ":" + strconv.Itoa(int(rest.Port))
listenv6Local := "[" + "::1" + "]" + ":" + strconv.Itoa(int(rest.Port))
if strings.ToLower(rest.Scheme) == "https" {
go HttpListenTLS(listenLocal, rest.CaFile, rest.CertFile, rest.KeyFile, app)
go HttpListenTLS(listenv6Local, rest.CaFile, rest.CertFile, rest.KeyFile, app)
} else {
go HttpListen(listenLocal, app)
go HttpListen(listenv6Local, app)
}
}
// ipv6 goroutines
@@ -222,13 +219,10 @@ func main() {
if rest.IPv6 != "::" {
// 默认启动localhost侦听
listenLocal := "127.0.0.1" + ":" + strconv.Itoa(int(rest.Port))
listenv6Local := "[" + "::1" + "]" + ":" + strconv.Itoa(int(rest.Port))
if strings.ToLower(rest.Scheme) == "https" {
go HttpListenTLS(listenLocal, rest.CaFile, rest.CertFile, rest.KeyFile, app)
go HttpListenTLS(listenv6Local, rest.CaFile, rest.CertFile, rest.KeyFile, app)
} else {
go HttpListen(listenLocal, app)
go HttpListen(listenv6Local, app)
}
}