aboutsummaryrefslogtreecommitdiffstats
path: root/node
diff options
context:
space:
mode:
authorBas van Kervel <bas@ethdev.com>2016-05-04 19:40:07 +0800
committerBas van Kervel <bas@ethdev.com>2016-05-06 18:00:47 +0800
commitd79f2f26569842121e6fafa9b3dbf48c2e589724 (patch)
tree59d82dbcf1d4e5e61282bc7d06d36f9dee2f1aad /node
parent2d7d7ef2fe08db84b0cd44ad2ec820cc965d4cad (diff)
downloaddexon-d79f2f26569842121e6fafa9b3dbf48c2e589724.tar.gz
dexon-d79f2f26569842121e6fafa9b3dbf48c2e589724.tar.zst
dexon-d79f2f26569842121e6fafa9b3dbf48c2e589724.zip
node: start RPC/WS interface on localhost by default
Diffstat (limited to 'node')
-rw-r--r--node/api.go12
1 files 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)