fix: 服务绑定127
This commit is contained in:
@@ -13,17 +13,9 @@ logger:
|
||||
# clientAuthType: 0:NoClientCert (default), 1:RequestClientCert, 2:RequireAnyClientCert,
|
||||
# 3:VerifyClientCertIfGiven, 4:RequireAndVerifyClientCerts
|
||||
rest:
|
||||
- ipv4: 0.0.0.0
|
||||
- ipv4: 127.0.0.1
|
||||
ipv6:
|
||||
port: 33030
|
||||
- ipv4: 0.0.0.0
|
||||
ipv6:
|
||||
port: 33443
|
||||
schema: https
|
||||
clientAuthType: 0
|
||||
caFile: /usr/local/omc/etc/certs/omc-ca.crt
|
||||
certFile: /usr/local/omc/etc/certs/omc-server.crt
|
||||
keyFile: /usr/local/omc/etc/certs/omc-server.key
|
||||
|
||||
webServer:
|
||||
enabled: false
|
||||
|
||||
@@ -16,14 +16,6 @@ rest:
|
||||
- ipv4: 0.0.0.0
|
||||
ipv6:
|
||||
port: 33040
|
||||
- ipv4: 0.0.0.0
|
||||
ipv6:
|
||||
port: 33443
|
||||
scheme: https
|
||||
clientAuthType: 0
|
||||
caFile: ./etc/certs/omc-ca.crt
|
||||
certFile: ./etc/certs/omc-server.crt
|
||||
keyFile: ./etc/certs/omc-server.key
|
||||
|
||||
webServer:
|
||||
enabled: false
|
||||
|
||||
18
omc/omc.go
18
omc/omc.go
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user