From 23b04b4e417cbe340631412fb55592ca3e02d235 Mon Sep 17 00:00:00 2001 From: Lutty Date: Thu, 26 Aug 2021 23:02:26 +0800 Subject: [PATCH] fix bug --- rpc/rpc.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/rpc/rpc.go b/rpc/rpc.go index f2360e899..0487b8de0 100644 --- a/rpc/rpc.go +++ b/rpc/rpc.go @@ -53,6 +53,7 @@ var ( wsListener net.Listener wsHandler *rpc.Server httpEndpoint = "" + httpAuthEndpoint = "" wsEndpoint = "" httpVirtualHosts = []string{"*"} httpTimeouts = rpc.DefaultHTTPTimeouts @@ -79,7 +80,7 @@ func StartServers(hmy *hmy.Harmony, apis []rpc.API, config nodeconfig.RPCServerC return err } - httpEndpoint = fmt.Sprintf("%v:%v", config.HTTPIp, config.HTTPAuthPort) + httpAuthEndpoint = fmt.Sprintf("%v:%v", config.HTTPIp, config.HTTPAuthPort) if err := startAuthHTTP(authApis); err != nil { return err } @@ -201,11 +202,11 @@ func startAuthHTTP(apis []rpc.API) (err error) { } utils.Logger().Info(). - Str("url", fmt.Sprintf("http://%s", httpEndpoint)). + Str("url", fmt.Sprintf("http://%s", httpAuthEndpoint)). Str("cors", strings.Join(httpOrigins, ",")). Str("vhosts", strings.Join(httpVirtualHosts, ",")). Msg("HTTP endpoint opened") - fmt.Printf("Started RPC server at: %v\n", httpEndpoint) + fmt.Printf("Started RPC server at: %v\n", httpAuthEndpoint) return nil }