fix: 服务绑定127

This commit is contained in:
TsMask
2024-03-22 20:15:01 +08:00
parent ee10888757
commit 2480cffe1c
3 changed files with 10 additions and 26 deletions

View File

@@ -204,15 +204,15 @@ func main() {
go HttpListen(listen, app)
}
}
if rest.IPv4 != "0.0.0.0" {
// 默认启动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" {
// // 默认启动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))