From 3c32f49d7bfb01087f0ba52a16b26061da07b09b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96mer=20Faruk=20IRMAK?= Date: Wed, 11 Oct 2023 09:40:04 +0300 Subject: [PATCH] Allow "/ws" prefixed paths on Websocket server --- node/http.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/node/http.go b/node/http.go index d923cb3585..10fb482b98 100644 --- a/node/http.go +++ b/node/http.go @@ -8,6 +8,7 @@ import ( "net/http" "net/http/pprof" "strconv" + "strings" "time" "github.com/NethermindEth/juno/db" @@ -105,6 +106,8 @@ func makeRPCOverWebsocket(host string, port uint16, servers map[string]*jsonrpc. wsHandler = wsHandler.WithListener(listener) } mux.Handle(path, exactPathServer(path, wsHandler)) + wsPrefixedPath := strings.TrimSuffix("/ws"+path, "/") + mux.Handle(wsPrefixedPath, exactPathServer(wsPrefixedPath, wsHandler)) } return makeHTTPService(host, port, cors.Default().Handler(mux)) }