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
{{ message }}
Repository navigation
Relay Websocket: Use permessage-deflate extension #1549
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.
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.
Note: with WeeChat ≥ 4.3.2, the websocket extension "permessage-deflate" will be disabled with "weechat" protocol, see my comment in this glowing-bear issue.
Activity
flashcode commentedon Jan 14, 2024
Hi,
First implementation is available in this development branch (target version is WeeChat 4.3.0, with a new
apirelay protocol): https://github.com/weechat/weechat/tree/relay-apiExtension permessage-deflate works for both
weechatandapiprotocols.JeremyMahieu commentedon Feb 2, 2024
Amazing, thanks for your effort.
flashcode commentedon Feb 2, 2024
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.
relay: add support of websocket extension "permessage-deflate" (closes …
flashcode commentedon Jun 2, 2024
Note: with WeeChat ≥ 4.3.2, the websocket extension "permessage-deflate" will be disabled with "weechat" protocol, see my comment in this glowing-bear issue.
core: add link to issue #1549 for ChangeLog entries about permessage-…
core: add link to issue #1549 for ChangeLog entries about permessage-…