Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
LuttyYang committed Aug 26, 2021
1 parent dd31a20 commit 23b04b4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions rpc/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ var (
wsListener net.Listener
wsHandler *rpc.Server
httpEndpoint = ""
httpAuthEndpoint = ""
wsEndpoint = ""
httpVirtualHosts = []string{"*"}
httpTimeouts = rpc.DefaultHTTPTimeouts
Expand All @@ -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
}
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit 23b04b4

Please sign in to comment.