ws
This commit is contained in:
@@ -2,6 +2,7 @@ package controllers
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
|
||||
@@ -19,6 +20,9 @@ type IMController struct {
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /StartWebSocket [get]
|
||||
func (c *IMController) StartWebSocket() {
|
||||
upgrader.CheckOrigin = func(r *http.Request) bool {
|
||||
return true
|
||||
}
|
||||
ws, err := upgrader.Upgrade(c.Ctx.ResponseWriter, c.Ctx.Request, nil)
|
||||
if err != nil {
|
||||
globals.SugarLogger.Errorf("upgrade error: %v", err)
|
||||
|
||||
Reference in New Issue
Block a user