perf: the browser terminal's WebSocket deflates larger messages

This commit is contained in:
redtea committed 2026-10-15 22:22:59 +03:00
1 parent a7e43ab700
commit 847bcd68c0
1 file changed
+3 -1
+3 -1
View File
@@ -136,7 +136,9 @@ func (s *Server) handlePanelTermWS(w http.ResponseWriter, r *http.Request) {
http.Error(w, "closed", http.StatusGone) http.Error(w, "closed", http.StatusGone)
return return
} }
conn, err := websocket.Accept(w, r, &websocket.AcceptOptions{CompressionMode: websocket.CompressionDisabled}) // Terminal text packs well: deflate with the context kept between
// messages, for the larger ones (screens of output, not keystrokes).
conn, err := websocket.Accept(w, r, &websocket.AcceptOptions{CompressionMode: websocket.CompressionContextTakeover, CompressionThreshold: 256})
if err != nil { if err != nil {
return return
} }