mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-30 00:00:16 +01:00
![]() info.protocols works okay, but it has an annoying problem... you have to know the type for each protocol's pss at the top level of the code, so you can set the struct lws_protocols user_data size for it. Lws already rewrites the protocol tables for a vhost in the case of runtime protocol plugins... this adapts that already-existing code slightly to give a new optional way to declare the protocol array. Everything works as before by default, but now info.protocols may be NULL and info.pprotocols defined instead (if that's also NULL, as it will be if you just ignore it after memsetting to 0, then it continues to fall back to the dummy protocol handler as before). info.pprotocols is a NULL-termined array of pointers to lws_protocol structs. This can be composed at the top level of your code without knowing anything except the name of the externally-defined lws_protocol struct(s). The minimal example http-server-dynamic is changed to use the new scheme as an example. |
||
---|---|---|
.. | ||
core | ||
core-net | ||
event-libs | ||
jose | ||
misc | ||
plat | ||
roles | ||
tls | ||
README.md |
Library sources layout
Code that goes in the libwebsockets library itself lives down ./lib
Path | Sources |
---|---|
lib/core | Core lws code related to generic fd and wsi servicing and management |
lib/event-libs | Code containing optional event-lib specific adaptations |
lib/jose | JOSE / JWS / JWK / JWE implementations |
lib/misc | Code for various mostly optional miscellaneous features |
lib/plat | Platform-specific adaptation code |
lib/roles | Code for specific optional wsi roles, eg, http/1, h2, ws, raw, etc |
lib/tls | Code supporting the various TLS libraries |
libwebsockets.h | Public API header for the whole of lws |