From f6372ad0c9f2fe759ee4269f4c215debf561f382 Mon Sep 17 00:00:00 2001 From: lesismal Date: Mon, 28 Aug 2023 21:07:13 +0800 Subject: [PATCH] websocket: enable/disable write compression as the remote does --- nbhttp/websocket/conn.go | 1 + 1 file changed, 1 insertion(+) diff --git a/nbhttp/websocket/conn.go b/nbhttp/websocket/conn.go index 34b6be3d..59508607 100644 --- a/nbhttp/websocket/conn.go +++ b/nbhttp/websocket/conn.go @@ -776,6 +776,7 @@ func NewConn(u *Upgrader, c net.Conn, subprotocol string, remoteCompressionEnabl subprotocol: subprotocol, remoteCompressionEnabled: remoteCompressionEnabled, } + wsc.EnableWriteCompression(remoteCompressionEnabled) if asyncWrite { wsc.sendQueue = make([][]byte, u.BlockingModSendQueueInitSize)[:0] wsc.sendQueueSize = u.BlockingModSendQueueMaxSize