Skip to content

Commit d79f2f2

Browse files
author
Bas van Kervel
committed
node: start RPC/WS interface on localhost by default
1 parent 2d7d7ef commit d79f2f2

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

node/api.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,11 @@ func (api *PrivateAdminAPI) StartRPC(host *string, port *rpc.HexNumber, cors *st
6868
}
6969

7070
if host == nil {
71-
host = &api.node.httpHost
71+
h := common.DefaultHTTPHost
72+
if api.node.httpHost != "" {
73+
h = api.node.httpHost
74+
}
75+
host = &h
7276
}
7377
if port == nil {
7478
port = rpc.NewHexNumber(api.node.httpPort)
@@ -113,7 +117,11 @@ func (api *PrivateAdminAPI) StartWS(host *string, port *rpc.HexNumber, allowedOr
113117
}
114118

115119
if host == nil {
116-
host = &api.node.wsHost
120+
h := common.DefaultWSHost
121+
if api.node.wsHost != "" {
122+
h = api.node.wsHost
123+
}
124+
host = &h
117125
}
118126
if port == nil {
119127
port = rpc.NewHexNumber(api.node.wsPort)

0 commit comments

Comments
 (0)