Disable WebSocket compression

This commit is contained in:
Noah 2023-03-31 12:40:55 -07:00
parent 4466bb0ef5
commit 3f6e2193c8

View File

@ -140,7 +140,9 @@ func (s *Server) WebSocket() http.HandlerFunc {
ip := util.IPAddress(r) ip := util.IPAddress(r)
log.Info("WebSocket connection from %s - %s", ip, r.Header.Get("User-Agent")) log.Info("WebSocket connection from %s - %s", ip, r.Header.Get("User-Agent"))
log.Debug("Headers: %+v", r.Header) log.Debug("Headers: %+v", r.Header)
c, err := websocket.Accept(w, r, nil) c, err := websocket.Accept(w, r, &websocket.AcceptOptions{
CompressionMode: websocket.CompressionDisabled,
})
if err != nil { if err != nil {
w.WriteHeader(http.StatusInternalServerError) w.WriteHeader(http.StatusInternalServerError)
fmt.Fprintf(w, "Could not accept websocket connection: %s", err) fmt.Fprintf(w, "Could not accept websocket connection: %s", err)