fix: 关闭启动时默认127.0.0..1的IP绑定
This commit is contained in:
@@ -251,7 +251,7 @@ func main() {
|
|||||||
// AMF上报的UE事件, 无前缀,暂时特殊处理
|
// AMF上报的UE事件, 无前缀,暂时特殊处理
|
||||||
app.POST(event.UriUEEventAMF, event.PostUEEventFromAMF)
|
app.POST(event.UriUEEventAMF, event.PostUEEventFromAMF)
|
||||||
|
|
||||||
var listenLocalhost bool = false
|
// var listenLocalhost bool = false
|
||||||
for _, rest := range conf.Rest {
|
for _, rest := range conf.Rest {
|
||||||
// ipv4 goroutines
|
// ipv4 goroutines
|
||||||
if rest.IPv4 != "" {
|
if rest.IPv4 != "" {
|
||||||
@@ -262,16 +262,16 @@ func main() {
|
|||||||
go HttpListen(listen, app)
|
go HttpListen(listen, app)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if rest.IPv4 != "0.0.0.0" && !listenLocalhost {
|
// if rest.IPv4 != "0.0.0.0" && !listenLocalhost {
|
||||||
listenLocalhost = true
|
// listenLocalhost = true
|
||||||
// 默认启动localhost侦听
|
// // 默认启动localhost侦听
|
||||||
listenLocal := "127.0.0.1" + ":" + strconv.Itoa(int(rest.Port))
|
// listenLocal := "127.0.0.1" + ":" + strconv.Itoa(int(rest.Port))
|
||||||
if strings.ToLower(rest.Scheme) == "https" {
|
// if strings.ToLower(rest.Scheme) == "https" {
|
||||||
go HttpListenTLS(listenLocal, rest.CaFile, rest.CertFile, rest.KeyFile, rest.ClientAuthType, app)
|
// go HttpListenTLS(listenLocal, rest.CaFile, rest.CertFile, rest.KeyFile, rest.ClientAuthType, app)
|
||||||
} else {
|
// } else {
|
||||||
go HttpListen(listenLocal, app)
|
// go HttpListen(listenLocal, app)
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
// ipv6 goroutines
|
// ipv6 goroutines
|
||||||
if rest.IPv6 != "" {
|
if rest.IPv6 != "" {
|
||||||
listenv6 := "[" + rest.IPv6 + "]" + ":" + strconv.Itoa(int(rest.Port))
|
listenv6 := "[" + rest.IPv6 + "]" + ":" + strconv.Itoa(int(rest.Port))
|
||||||
|
|||||||
Reference in New Issue
Block a user