perf: the browser terminal's WebSocket deflates larger messages
This commit is contained in:
1 parent
a7e43ab700
commit
847bcd68c0
1 file changed
+3
-1
@@ -136,7 +136,9 @@ func (s *Server) handlePanelTermWS(w http.ResponseWriter, r *http.Request) {
|
||||
http.Error(w, "closed", http.StatusGone)
|
||||
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 {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user