node: always show websocket url in logs (#22307)

This commit is contained in:
Martin Holst Swende 2021-02-18 10:40:19 +01:00 committed by GitHub
parent 9ec32a9e7b
commit b1835b3855
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -144,13 +144,15 @@ func (h *httpServer) start() error {
h.listener = listener
go h.server.Serve(listener)
// if server is websocket only, return after logging
if h.wsAllowed() && !h.rpcAllowed() {
if h.wsAllowed() {
url := fmt.Sprintf("ws://%v", listener.Addr())
if h.wsConfig.prefix != "" {
url += h.wsConfig.prefix
}
h.log.Info("WebSocket enabled", "url", url)
}
// if server is websocket only, return after logging
if !h.rpcAllowed() {
return nil
}
// Log http endpoint.