Skip to content

Commit

Permalink
Allow "/ws" prefixed paths on Websocket server
Browse files Browse the repository at this point in the history
  • Loading branch information
omerfirmak committed Oct 11, 2023
1 parent 522fb4f commit 3c32f49
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions node/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"net/http"
"net/http/pprof"
"strconv"
"strings"
"time"

"github.com/NethermindEth/juno/db"
Expand Down Expand Up @@ -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))
}
Expand Down

0 comments on commit 3c32f49

Please sign in to comment.