From af81ea10f0a167a34d3fb1f4ef4425f2654d3969 Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Tue, 5 Sep 2023 14:08:55 +0800 Subject: [PATCH] fix --- server/websocket/etc/websocket.yaml | 4 ++-- server/websocket/internal/logic/datatransferlogic.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/websocket/etc/websocket.yaml b/server/websocket/etc/websocket.yaml index e109edb5..e7b4197d 100644 --- a/server/websocket/etc/websocket.yaml +++ b/server/websocket/etc/websocket.yaml @@ -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 diff --git a/server/websocket/internal/logic/datatransferlogic.go b/server/websocket/internal/logic/datatransferlogic.go index 8c0536e2..bb28ae2e 100644 --- a/server/websocket/internal/logic/datatransferlogic.go +++ b/server/websocket/internal/logic/datatransferlogic.go @@ -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是正常用户,无则是白板用户,也可以连接