[Libwebsockets] serving compressed http response from a zip archive

Andy Green andy at warmcat.com
Tue Feb 14 03:31:49 CET 2017

On 02/14/2017 10:23 AM, Per Bothner wrote:
> On 02/13/2017 05:50 PM, Andy Green wrote:
>> No this is great, I pushed it on master already.
> Thanks - I confirmed it works.
>> I take it we want to improve the vfs fd to have private data + 
>> pointer to context or ops, then think about how to generalize / 
>> integrate your gzip work?
> If serve-from-zip support is something you'd like to include
> in stock libwebsockets that I'm happy to help with that.

Yes this would be a nice feature I think... if storage is tight and 
it's, eg, large html or JS that is needed, from lws device side this 
costs no extra cpu with a client that can accept gzip (all browsers 
afaik), and delivers the same data quicker with less bandwidth (for 
text, with really quite considerable compression factors).  The client 
has to deal with it but often the clients are modern PCs or modern 
phones / tablets that just shrug it off.
> Regardless an easier-to-use VFS layer would be good.
Yes I agree, I will take a look at it later today.
> My immediate problem is that I use JUnZip, which I quickly
> realized has major portability programs - it assumes both a
> little-endian architecture and gcc __packed__ attributes.
> So I have to decide to clean up junzip (compact, familiar)
> or use some other library (probably contrib/minizip from zlib).
> (The former is probably easier.)

zlib is already integrated to lws for permessage-deflate ws extension fwiw.


More information about the Libwebsockets mailing list