Skip to content

Commit 11d84d6

Browse files
committed
feat: accept websocket connections from all origins
This was a problem with hoppscotch who set the origin to their website what caused the connection to fail.
1 parent 4a6ff44 commit 11d84d6

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

internal/web/server.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,10 @@ func NewWebsocketServer(networkIf string, port int, certPath, keyPath string) *W
262262

263263
upgrader = websocket.Upgrader{
264264
EnableCompression: config.AppConfig.Webserver.CompressionEnabled,
265+
CheckOrigin: func(r *http.Request) bool {
266+
// Allow all connections by default
267+
return true
268+
},
265269
}
266270

267271
if config.AppConfig.Webserver.RealIP {

0 commit comments

Comments
 (0)