You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead of manually applying zlib, consider adding support for permessage-deflate websocket extension. Which is by default used in webbrowsers.
Clients sets the Sec-WebSocket-Extensions: permessage-deflate; header for the websocket, browsers already do this
Server (weechat) also sets the Sec-WebSocket-Extensions: permessage-deflate; header
Server implements the compression and decompression: some sample in C
What does this impove:
Websocket now has compression in both directions. Before it was only in the server -> client direction.
Messages can be read in the dev console of the browser even with compression applied, very important for debugging
Clients can leave out extra libraries such as zlib's inflate.js and a bunch of code to facilitate this compression and let the browser handle it.
Perfectly backwards and forwards compattible: If the server does not set the header, there is no problem, it just won't be compressed, so backwards compatibility is fine. New clients will work with old weechat. In the other direction, because of the headers in the binary files, they will see it's uncompressed and it will also keep working. Or you could keep the zlib implementation server side and new clients would always choose compression=off.
The text was updated successfully, but these errors were encountered:
I forgot to mention here, this has been implemented while adding a new "api" relay (HTTP REST API), which was designed to fix the design of "weechat" protocol (permessage-deflate is supported in both), see: #2066.
API protocol is under development, and when finished, it should deprecate completely the "weechat" protocol.
Feature description
Instead of manually applying zlib, consider adding support for
permessage-deflate
websocket extension. Which is by default used in webbrowsers.Sec-WebSocket-Extensions: permessage-deflate;
header for the websocket, browsers already do thisSec-WebSocket-Extensions: permessage-deflate;
headerWhat does this impove:
compression=off
.The text was updated successfully, but these errors were encountered: