From 2480cffe1c039748b035ba2040e68f3fe5a5bdfd Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Fri, 22 Mar 2024 20:15:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9C=8D=E5=8A=A1=E7=BB=91=E5=AE=9A127?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/config/etc/default/omc.yaml | 10 +--------- omc/etc/omc.yaml | 8 -------- omc/omc.go | 18 +++++++++--------- 3 files changed, 10 insertions(+), 26 deletions(-) diff --git a/build/config/etc/default/omc.yaml b/build/config/etc/default/omc.yaml index 28eccaf..aae7764 100644 --- a/build/config/etc/default/omc.yaml +++ b/build/config/etc/default/omc.yaml @@ -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 diff --git a/omc/etc/omc.yaml b/omc/etc/omc.yaml index f98167b..dc1bfd0 100644 --- a/omc/etc/omc.yaml +++ b/omc/etc/omc.yaml @@ -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 diff --git a/omc/omc.go b/omc/omc.go index 7bc6966..b708d4e 100644 --- a/omc/omc.go +++ b/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))