mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-16 00:00:07 +01:00
![]() This adds a per-streamtype JSON mapping table in the policy. In addition to the previous flow, it lets you generate custom SS state notifications for specific http response codes, eg: "http_resp_map": [ { "530": 1530 }, { "531": 1531 } ], It's not recommended to overload the transport-layer response code with application layer responses. It's better to return a 200 and then in the application protocol inside http, explain what happened from the application perspective, usually with JSON. But this is designed to let you handle existing systems that do overload the transport layer response code. SS states for user use start at LWSSSCS_USER_BASE, which is 1000. You can do a basic test with minimal-secure-streams and --respmap flag, this will go to httpbin.org and get a 404, and the warmcat.com policy has the mapping for 404 -> LWSSSCS_USER_BASE (1000). Since the mapping emits states, these are serialized and handled like any other state in the proxy case. The policy2c example / tool is also updated to handle the additional mapping tables. |
||
---|---|---|
.. | ||
libwebsockets | ||
libwebsockets.h |