fix(realtime): 修复ws 握手失败、计费问题

(cherry picked from commit 618dffc43fd5a5f4065944db87761f9ee18e44d3)
This commit is contained in:
Xyfacai
2024-10-10 00:15:27 +08:00
committed by CalciumIon
parent d596699250
commit be64408a25
4 changed files with 28 additions and 10 deletions

View File

@@ -145,6 +145,7 @@ func Relay(c *gin.Context) {
}
var upgrader = websocket.Upgrader{
Subprotocols: []string{"realtime"}, // WS 握手支持的协议,如果有使用 Sec-WebSocket-Protocol则必须在此声明对应的 Protocol TODO add other protocol
CheckOrigin: func(r *http.Request) bool {
return true // 允许跨域
},