|
|
@ -53,6 +53,7 @@ var ( |
|
|
|
wsListener net.Listener |
|
|
|
wsListener net.Listener |
|
|
|
wsHandler *rpc.Server |
|
|
|
wsHandler *rpc.Server |
|
|
|
httpEndpoint = "" |
|
|
|
httpEndpoint = "" |
|
|
|
|
|
|
|
httpAuthEndpoint = "" |
|
|
|
wsEndpoint = "" |
|
|
|
wsEndpoint = "" |
|
|
|
httpVirtualHosts = []string{"*"} |
|
|
|
httpVirtualHosts = []string{"*"} |
|
|
|
httpTimeouts = rpc.DefaultHTTPTimeouts |
|
|
|
httpTimeouts = rpc.DefaultHTTPTimeouts |
|
|
@ -79,7 +80,7 @@ func StartServers(hmy *hmy.Harmony, apis []rpc.API, config nodeconfig.RPCServerC |
|
|
|
return err |
|
|
|
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 { |
|
|
|
if err := startAuthHTTP(authApis); err != nil { |
|
|
|
return err |
|
|
|
return err |
|
|
|
} |
|
|
|
} |
|
|
@ -201,11 +202,11 @@ func startAuthHTTP(apis []rpc.API) (err error) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
utils.Logger().Info(). |
|
|
|
utils.Logger().Info(). |
|
|
|
Str("url", fmt.Sprintf("http://%s", httpEndpoint)). |
|
|
|
Str("url", fmt.Sprintf("http://%s", httpAuthEndpoint)). |
|
|
|
Str("cors", strings.Join(httpOrigins, ",")). |
|
|
|
Str("cors", strings.Join(httpOrigins, ",")). |
|
|
|
Str("vhosts", strings.Join(httpVirtualHosts, ",")). |
|
|
|
Str("vhosts", strings.Join(httpVirtualHosts, ",")). |
|
|
|
Msg("HTTP endpoint opened") |
|
|
|
Msg("HTTP endpoint opened") |
|
|
|
fmt.Printf("Started RPC server at: %v\n", httpEndpoint) |
|
|
|
fmt.Printf("Started RPC server at: %v\n", httpAuthEndpoint) |
|
|
|
return nil |
|
|
|
return nil |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|