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