|
|
@@ -3,19 +3,23 @@ package ws
|
|
|
import (
|
|
|
"encoding/json"
|
|
|
"fmt"
|
|
|
- "github.com/gorilla/websocket"
|
|
|
"goseg/auth"
|
|
|
"goseg/broadcast"
|
|
|
"goseg/config"
|
|
|
"goseg/structs"
|
|
|
"net/http"
|
|
|
"time"
|
|
|
+
|
|
|
+ "github.com/gorilla/websocket"
|
|
|
)
|
|
|
|
|
|
var (
|
|
|
upgrader = websocket.Upgrader{
|
|
|
ReadBufferSize: 1024,
|
|
|
WriteBufferSize: 1024,
|
|
|
+ CheckOrigin: func(r *http.Request) bool {
|
|
|
+ return true // Allow all origins
|
|
|
+ },
|
|
|
}
|
|
|
)
|
|
|
|
|
|
@@ -164,4 +168,4 @@ func verifyHandler(msg []byte, payload structs.WsPayload, r *http.Request, conn
|
|
|
func supportHandler(msg []byte, payload structs.WsPayload, r *http.Request, conn *websocket.Conn) error {
|
|
|
config.Logger.Info("Support")
|
|
|
return nil
|
|
|
-}
|
|
|
+}
|