Accept all origins to allow client to connect

This commit is contained in:
Maciej Krzyżanowski 2024-06-03 20:42:23 +00:00
parent 15babe60d1
commit fff246214c

View File

@ -558,7 +558,11 @@ func testEcho(hdlCtx *HandlerContext) {
} }
func (ctx *Context) wsapiHandler(w http.ResponseWriter, r *http.Request) { func (ctx *Context) wsapiHandler(w http.ResponseWriter, r *http.Request) {
upgrader := websocket.Upgrader{} upgrader := websocket.Upgrader{
CheckOrigin: func(r *http.Request) bool {
return true // Allow all origins
},
}
conn, err := upgrader.Upgrade(w, r, nil) conn, err := upgrader.Upgrade(w, r, nil)
if err != nil { if err != nil {