1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-30 00:00:16 +01:00
libwebsockets/minimal-examples/secure-streams
Andy Green 101b474217 ss: rx metadata
At the moment you can define and set per-stream metadata at the client,
which will be string-substituted and if configured in the policy, set in
related outgoing protocol specific content like h1 headers.

This patch extends the metadata concept to also check incoming protocol-
specific content like h1 headers and where it matches the binding in the
streamtype's metadata entry, make it available to the client by name, via
a new lws_ss_get_metadata() api.

Currently warmcat.com has additional headers for

server: lwsws                (well-known header name)
test-custom-header: hello    (custom header name)

minimal-secure-streams test is updated to try to recover these both
in direct and -client (via proxy) versions.  The corresponding metadata
part of the "mintest" stream policy from warmcat.com is

                        {
                                "srv": "server:"
                        }, {
                                "test": "test-custom-header:"
                        },

If built direct, or at the proxy, the stream has access to the static
policy metadata definitions and can store the rx metadata in the stream
metadata allocation, with heap-allocated a value.  For client side that
talks to a proxy, only the proxy knows the policy, and it returns rx
metadata inside the serialized link to the client, which stores it on
the heap attached to the stream.

In addition an optimization for mapping static policy metadata definitions
to individual stream handle metadata is changed to match by name.
2020-09-16 13:10:26 +01:00
..
minimal-secure-streams ss: rx metadata 2020-09-16 13:10:26 +01:00
minimal-secure-streams-alexa sspc: fix intree build for sspc examples and increase post example body 2020-08-13 16:48:16 +01:00
minimal-secure-streams-avs sspc: fix intree build for sspc examples and increase post example body 2020-08-13 16:48:16 +01:00
minimal-secure-streams-client-tx cmake: provide LIBWEBSOCKETS_DEP_LIBS in CONFIG 2020-06-16 19:45:35 +01:00
minimal-secure-streams-metadata sspc: fix intree build for sspc examples and increase post example body 2020-08-13 16:48:16 +01:00
minimal-secure-streams-policy2c ss: rx metadata 2020-09-16 13:10:26 +01:00
minimal-secure-streams-post event libs: default to building as dynamically loaded plugins 2020-08-31 16:51:37 +01:00
minimal-secure-streams-proxy lws_smd: system message distribution 2020-06-27 07:57:22 +01:00
minimal-secure-streams-seq cmake: provide LIBWEBSOCKETS_DEP_LIBS in CONFIG 2020-06-16 19:45:35 +01:00
minimal-secure-streams-server event libs: default to building as dynamically loaded plugins 2020-08-31 16:51:37 +01:00
minimal-secure-streams-server-raw lws_smd: take care about build with disabled 2020-08-16 05:35:56 +01:00
minimal-secure-streams-smd sspc: fix intree build for sspc examples and increase post example body 2020-08-13 16:48:16 +01:00
minimal-secure-streams-staticpolicy ss: rx metadata 2020-09-16 13:10:26 +01:00
README.md client: secure streams 2020-03-04 12:17:49 +00:00

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