[Libwebsockets] How to tell if permessage-deflate is available?

Andy Green andy at warmcat.com
Tue Jun 29 07:06:21 CEST 2021



On 6/29/21 2:07 AM, Felipe Gasper wrote:
> Hello,
> 
> 	Does LWS expose any constants or macros that can indicate at runtime whether the LWS build includes permessage-deflate support?

You should be able to understand it (in user or lws code) from

#if defined(LWS_ROLE_WS) && !defined(LWS_WITHOUT_EXTENSIONS)
... the support is present ...
#endif

The extensions info struct exists either way, you will get a nonfatal 
LLL_WARN log if you set it to create a context not built for 
permessage-deflate as a nudge why that's not going to work, but that's all.

-Andy


More information about the Libwebsockets mailing list