From 82fa26f2321f987ace5989e46b5135c606601c81 Mon Sep 17 00:00:00 2001 From: George Knee Date: Thu, 4 May 2023 13:42:55 +0100 Subject: [PATCH] add "*" as acceptable origin This is necessary for allowing connections from our CLI tool https://github.com/statechannels/nitro-gui/tree/main/packages/nitro-rpc-client --- rpc/transport/ws/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpc/transport/ws/server.go b/rpc/transport/ws/server.go index 4c0cefc85..c5924e65b 100644 --- a/rpc/transport/ws/server.go +++ b/rpc/transport/ws/server.go @@ -106,7 +106,7 @@ func (wsc *serverWebSocketTransport) request(w http.ResponseWriter, r *http.Requ func (wsc *serverWebSocketTransport) subscribe(w http.ResponseWriter, r *http.Request) { // Allow all localhost origins to connect via websocket - opts := &websocket.AcceptOptions{OriginPatterns: []string{"*localhost*"}} + opts := &websocket.AcceptOptions{OriginPatterns: []string{"*localhost*", "*"}} c, err := websocket.Accept(w, r, opts) if err != nil { panic(err)