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. |
||
---|---|---|
.. | ||
minimal-secure-streams | ||
minimal-secure-streams-alexa | ||
minimal-secure-streams-avs | ||
minimal-secure-streams-client-tx | ||
minimal-secure-streams-metadata | ||
minimal-secure-streams-policy2c | ||
minimal-secure-streams-post | ||
minimal-secure-streams-proxy | ||
minimal-secure-streams-seq | ||
minimal-secure-streams-server | ||
minimal-secure-streams-server-raw | ||
minimal-secure-streams-smd | ||
minimal-secure-streams-staticpolicy | ||
README.md |
Secure Streams
Secure Streams is a client API that strictly decouples the policy for connections
from the payloads. The user code only deals with the stream type name and payloads,
a policy database set at lws_context
creation time decides all policy about the
connection, including the endpoint, tls CA, and even the wire protocol.
name | demonstrates |
---|---|
minimal-secure-streams | Minimal secure streams client / proxy example |
minimal-secure-streams-tx | Proxy used for client-tx test below |
minimal-secure-streams-client-tx | Secure streams client showing tx and rx |