This commit is contained in:
laodaming
2023-09-05 14:08:55 +08:00
parent 1ba6a0ed64
commit af81ea10f0
2 changed files with 4 additions and 4 deletions

View File

@@ -119,12 +119,12 @@ func (l *DataTransferLogic) DataTransfer(w http.ResponseWriter, r *http.Request)
origin := r.Header.Get("Origin")
fmt.Println("*************:", origin)
//判断是不是允许的host
/*upgrader.CheckOrigin = func(r *http.Request) bool {
upgrader.CheckOrigin = func(r *http.Request) bool {
if _, ok := mapAllowOrigin[origin]; !ok {
return false
}
return true
}*/
}
//把子协议携带的token设置到标准token头信息中
token := r.Header.Get("Sec-Websocket-Protocol")
//有token是正常用户无则是白板用户也可以连接