Skip to content

Commit 3c32f49

Browse files
committed
Allow "/ws" prefixed paths on Websocket server
1 parent 522fb4f commit 3c32f49

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

node/http.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"net/http"
99
"net/http/pprof"
1010
"strconv"
11+
"strings"
1112
"time"
1213

1314
"github.com/NethermindEth/juno/db"
@@ -105,6 +106,8 @@ func makeRPCOverWebsocket(host string, port uint16, servers map[string]*jsonrpc.
105106
wsHandler = wsHandler.WithListener(listener)
106107
}
107108
mux.Handle(path, exactPathServer(path, wsHandler))
109+
wsPrefixedPath := strings.TrimSuffix("/ws"+path, "/")
110+
mux.Handle(wsPrefixedPath, exactPathServer(wsPrefixedPath, wsHandler))
108111
}
109112
return makeHTTPService(host, port, cors.Default().Handler(mux))
110113
}

0 commit comments

Comments
 (0)