lua-resty-websocket icon indicating copy to clipboard operation
lua-resty-websocket copied to clipboard

Compression support

Open stuta opened this issue 12 years ago • 7 comments

Hello.

Is it possible to get some kind of data compression like in the link below? Json payload can be very big and native compression (in browser side) woud be abolutely fanstastic.

http://tools.ietf.org/html/draft-ietf-hybi-permessage-compression-13

stuta avatar Oct 25 '13 01:10 stuta

@stuta Do you know any of the mainstream web browsers already support this per-message compression extension?

agentzh avatar Oct 25 '13 23:10 agentzh

http://stackoverflow.com/questions/19298651/how-does-websocket-compress-messages http://www.ietf.org/mail-archive/web/hybi/current/msg10109.html

"Some of the extensions seen in the wild:

x-webkit-deflate-frame - an early proposed compression that compresses each raw websocket data frame. Seen in use by Chrome and Safari. perframe-deflate - a renamed version of the above compression. Seen in use by various websocket server implementations, and also briefly showed up in various WebKit based clients. permessage-deflate - the name of the formalized spec for using deflate to compress entire messages, regardless of the number of websocket frames. Of note, the permessage-deflate is the first in a line of PMCE (Per-Message Compression Extensions) that will eventually include other compression schemes (ones being discussed are permessage-bzip2, permessage-lz4, and permessage-snappy)"

So Safari, Chrome and Chrome Canary have something.

Javascript impelementations of compression algorithms are very slow. I don't care what kind of compression technique is used, but something is needed. I'm sure this will come soon and it will be huge benifit when trasferring big amounts of json data.

I'm redy to do performance tests with Chrome Canary or with any other browser.

stuta avatar Oct 26 '13 01:10 stuta

@stuta Thank you for the information. It'll be great if you can create your own git branch and experiment with the compression extension.

agentzh avatar Oct 26 '13 03:10 agentzh

A good article about the issue: http://www.igvita.com/2013/11/27/configuring-and-optimizing-websocket-compression/

bungle avatar Nov 27 '13 20:11 bungle

Hello. I write extension plugin manager for websocket and permessage-deflate extension. I test it with my websocket implementation and it pass all AutoBahn tests (client and server). I think it should be quite easy to integrate it to your library.

moteus avatar Mar 22 '16 10:03 moteus

@moteus Pull requests welcome.

agentzh avatar Mar 22 '16 19:03 agentzh

Compression support integrated in this library would be great.

Meanwhile do anyone have an example using compression with this library in conjunction with a plugin like @moteus's extension?

edubart avatar Jun 05 '17 13:06 edubart