fix: 默认启动localhost侦听
This commit is contained in:
@@ -197,17 +197,7 @@ func main() {
|
|||||||
} else {
|
} else {
|
||||||
go HttpListen(listen, app)
|
go HttpListen(listen, app)
|
||||||
}
|
}
|
||||||
}
|
} else if rest.IPv4 != "0.0.0.0" {
|
||||||
// ipv6 goroutines
|
|
||||||
if rest.IPv6 != "" {
|
|
||||||
listenv6 := "[" + rest.IPv6 + "]" + ":" + strconv.Itoa(int(rest.Port))
|
|
||||||
if strings.ToLower(rest.Scheme) == "https" {
|
|
||||||
go HttpListenTLS(listenv6, rest.CaFile, rest.CertFile, rest.KeyFile, app)
|
|
||||||
} else {
|
|
||||||
go HttpListen(listenv6, app)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 默认启动localhost侦听
|
// 默认启动localhost侦听
|
||||||
listenLocal := "127.0.0.1" + ":" + strconv.Itoa(int(rest.Port))
|
listenLocal := "127.0.0.1" + ":" + strconv.Itoa(int(rest.Port))
|
||||||
listenv6Local := "[" + "::1" + "]" + ":" + strconv.Itoa(int(rest.Port))
|
listenv6Local := "[" + "::1" + "]" + ":" + strconv.Itoa(int(rest.Port))
|
||||||
@@ -219,6 +209,28 @@ func main() {
|
|||||||
go HttpListen(listenv6Local, app)
|
go HttpListen(listenv6Local, app)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// ipv6 goroutines
|
||||||
|
if rest.IPv6 != "" {
|
||||||
|
listenv6 := "[" + rest.IPv6 + "]" + ":" + strconv.Itoa(int(rest.Port))
|
||||||
|
if strings.ToLower(rest.Scheme) == "https" {
|
||||||
|
go HttpListenTLS(listenv6, rest.CaFile, rest.CertFile, rest.KeyFile, app)
|
||||||
|
} else {
|
||||||
|
go HttpListen(listenv6, app)
|
||||||
|
}
|
||||||
|
} else 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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if conf.WebServer.Enabled {
|
if conf.WebServer.Enabled {
|
||||||
fs := http.FileServer(http.Dir(conf.WebServer.RootDir))
|
fs := http.FileServer(http.Dir(conf.WebServer.RootDir))
|
||||||
|
|||||||
Reference in New Issue
Block a user