From 18bbc6788fb5da5d0f8200693ff94db28f9ae3bf Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Thu, 27 Jul 2023 19:30:40 +0800 Subject: [PATCH] fix --- server/websocket/internal/logic/datatransferlogic.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/server/websocket/internal/logic/datatransferlogic.go b/server/websocket/internal/logic/datatransferlogic.go index e2056ba4..b4ffae61 100644 --- a/server/websocket/internal/logic/datatransferlogic.go +++ b/server/websocket/internal/logic/datatransferlogic.go @@ -44,14 +44,17 @@ var ( } //升级websocket upgrade = websocket.Upgrader{ - ReadBufferSize: 1024 * 10, //最大可读取大小 10M + //最大可读取大小 10M + ReadBufferSize: 1024 * 10, //握手超时时间15s HandshakeTimeout: time.Second * 15, //允许跨域 CheckOrigin: func(r *http.Request) bool { return true }, - WriteBufferPool: &buffPool, + //写的缓存池 + WriteBufferPool: &buffPool, + //是否支持压缩 EnableCompression: true, } //websocket连接存储