fix: 默认启动localhost侦听

This commit is contained in:
2023-12-20 17:18:03 +08:00
parent 2d607f903c
commit 684283d761

View File

@@ -197,7 +197,8 @@ func main() {
} else {
go HttpListen(listen, app)
}
} else if rest.IPv4 != "0.0.0.0" {
}
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))
@@ -217,7 +218,9 @@ func main() {
} else {
go HttpListen(listenv6, app)
}
} else if rest.IPv6 != "::" {
}
if rest.IPv6 != "::" {
// 默认启动localhost侦听
listenLocal := "127.0.0.1" + ":" + strconv.Itoa(int(rest.Port))
listenv6Local := "[" + "::1" + "]" + ":" + strconv.Itoa(int(rest.Port))
@@ -229,7 +232,6 @@ func main() {
go HttpListen(listenv6Local, app)
}
}
}
if conf.WebServer.Enabled {