[Libwebsockets] LWS and permessage-deflate

Andy Green andy at warmcat.com
Tue Jul 6 21:30:43 CEST 2021



On 7/6/21 4:09 PM, Felipe Gasper wrote:
> Hello,
> 
> 	The WS compression spec (RFC 7692) describes a workflow where giving permessage-deflate multiple times in the client handshake allows the server to choose which configuration it will allow.
> 
> 	(cf. https://datatracker.ietf.org/doc/html/rfc7692#section-7.1.3)
> 
> 	Does LWS support this? I don’t have a server implementation set up that facilitates easy testing, but would it be something like this?
> 
> -----
> struct lws_extension[] extensions = {
>      {
>          .name = "permessage-deflate",
>          .callback = lws_extension_callback_pm_deflate,
>          .client_offer = "permessage-deflate; client_max_window_bits; server_max_window_bits=10",
>      },
>      {
>          .name = "permessage-deflate",
>          .callback = lws_extension_callback_pm_deflate,
>          .client_offer = "permessage-deflate; client_max_window_bits",
>      },
>      { NULL },
> };

As far as I can recall, yes it's supported to list your extension client 
offer sets and the negotiation picks one.

-Andy



More information about the Libwebsockets mailing list