I'm using libevent2 in my application to host a http server. I cant find a built-in way to compress the output.
These are the options I'm considering:
- Apply gzip/deflate compression using zlib in my app before sending out the response
- Hack libevent's http.c to expose evhttp_connection->bufev (the bufferevent object), and apply a zlib filter for outgoing data
(Both read the supported compression formats from the Accept-Encoding header)
Is there some easier way I'm overlooking, or is this pretty much it?