fix
This commit is contained in:
parent
038ac93db4
commit
290859eaa2
|
@ -3,8 +3,8 @@ Host: 0.0.0.0
|
|||
Port: 9914
|
||||
ReplicaId: 95
|
||||
Timeout: 15000 #服务超时时间
|
||||
CertFile: "/opt/server.fusen.3718.cn.pem"
|
||||
KeyFile: "/opt/server.fusen.3718.cn.key"
|
||||
#CertFile: "/opt/server.fusen.3718.cn.pem"
|
||||
#KeyFile: "/opt/server.fusen.3718.cn.key"
|
||||
SourceMysql: "fsreaderwriter:XErSYmLELKMnf3Dh@tcp(fusen.cdmigcvz3rle.us-east-2.rds.amazonaws.com:3306)/fusen"
|
||||
Log:
|
||||
Stat: false
|
||||
|
|
|
@ -116,12 +116,14 @@ type wsConnectItem struct {
|
|||
|
||||
// 请求建立连接,升级websocket协议
|
||||
func (l *DataTransferLogic) DataTransfer(w http.ResponseWriter, r *http.Request) {
|
||||
//判断是不是允许的origin
|
||||
/*if _, ok := mapAllowOrigin[r.Header.Get("Origin")]; !ok {
|
||||
upgrader.CheckOrigin = func(r *http.Request) bool {
|
||||
origin := r.Header.Get("Origin")
|
||||
//判断是不是允许的host
|
||||
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是正常用户,无则是白板用户,也可以连接
|
||||
|
|
Loading…
Reference in New Issue
Block a user