warp icon indicating copy to clipboard operation
warp copied to clipboard

WebSocket permessage-deflate extension support

Open novacrazy opened this issue 4 years ago • 2 comments

Sec-WebSocket-Extensions: permessage-deflate and such is available in Firefox and Chrome, and utilizing it natively would eliminate the need to load large JavaScript decompression libraries on the client-side. (Large as in about 28KB min-gzipped) The native implementation in-browser is probably faster than Javascript codecs as well.

Ideally, this could be automatic, as the compression is transparent. However, it should also be able to signal to the user code that compression extensions are unavailable, so it could fallback and signal to load those aforementioned libraries.

The alternative would be to just continue doing it manually. I'm simply using flate2 and sending/receiving binary messages.

Perhaps this is more an issue for tokio-tungstenite?

novacrazy avatar Dec 31 '20 19:12 novacrazy

Hi! yeah, see https://github.com/snapview/tungstenite-rs/pull/144

jxs avatar Jan 12 '21 16:01 jxs

See https://github.com/snapview/tungstenite-rs/pull/235. To support warp, something like https://github.com/seanmonstar/warp/compare/master...kazk:permessage-deflate

kazk avatar Sep 13 '21 20:09 kazk