From d79f2f26569842121e6fafa9b3dbf48c2e589724 Mon Sep 17 00:00:00 2001 From: Bas van Kervel Date: Wed, 4 May 2016 13:40:07 +0200 Subject: node: start RPC/WS interface on localhost by default --- node/api.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/node/api.go b/node/api.go index f199a8d3d..9b2be9c2e 100644 --- a/node/api.go +++ b/node/api.go @@ -68,7 +68,11 @@ func (api *PrivateAdminAPI) StartRPC(host *string, port *rpc.HexNumber, cors *st } if host == nil { - host = &api.node.httpHost + h := common.DefaultHTTPHost + if api.node.httpHost != "" { + h = api.node.httpHost + } + host = &h } if port == nil { port = rpc.NewHexNumber(api.node.httpPort) @@ -113,7 +117,11 @@ func (api *PrivateAdminAPI) StartWS(host *string, port *rpc.HexNumber, allowedOr } if host == nil { - host = &api.node.wsHost + h := common.DefaultWSHost + if api.node.wsHost != "" { + h = api.node.wsHost + } + host = &h } if port == nil { port = rpc.NewHexNumber(api.node.wsPort) -- cgit