1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-16 00:00:07 +01:00
libwebsockets/minimal-examples/secure-streams
Andy Green 42dc817d8f ss: proxy: get rx flow control working
This fixes the proxy rx flow by adding an lws_dsh helper to hide the
off-by-one in the "kind" array (kind 0 is reserved for tracking the
unallocated dsh blocks).

For testing, it adds a --blob option on minimal-secure-streams[-client]
which uses a streamtype "bulkproxflow" from here

https://warmcat.com/policy/minimal-proxy-v4.2-v2.json

		"bulkproxflow": {
			"endpoint": "warmcat.com",
			"port": 443,
			"protocol": "h1",
			"http_method": "GET",
			"http_url": "blob.bin",
			"proxy_buflen": 32768,
			"proxy_buflen_rxflow_on_above": 24576,
			"proxy_buflen_rxflow_off_below": 8192,
			"tls": true,
			"retry": "default",
			"tls_trust_store": "le_via_dst"
		}

This downloads a 51MB blob of random data with the SHA256sum

ed5720c16830810e5829dfb9b66c96b2e24efc4f93aa5e38c7ff4150d31cfbbf

The minimal-secure-streams --blob example client delays the download by
50ms every 10KiB it sees to force rx flow usage at the proxy.

It downloads the whole thing and checks the SHA256 is as expected.

Logs about rxflow status are available at LLL_INFO log level.
2021-04-07 15:54:26 +01:00
..
minimal-secure-streams ss: proxy: get rx flow control working 2021-04-07 15:54:26 +01:00
minimal-secure-streams-alexa lws_metrics 2021-03-08 21:47:28 +00:00
minimal-secure-streams-avs logs: prioritize WITH_NO_LOGS even in release 2021-03-15 12:56:15 +00:00
minimal-secure-streams-client-tx minimal-ss-client-tx: add -c flag for count of rx to get 2021-02-26 08:23:12 +00:00
minimal-secure-streams-cpp wip: ss c++ classes 2020-12-02 10:15:50 +00:00
minimal-secure-streams-hugeurl ctest: ss: minimal-hugeurl: run correct test 2021-04-05 11:06:54 +01:00
minimal-secure-streams-metadata ss: force check all set_metadata returns 2021-03-14 08:58:26 +00:00
minimal-secure-streams-metrics-proxy lws_metrics 2021-03-08 21:47:28 +00:00
minimal-secure-streams-perf ss: proxy: get rx flow control working 2021-04-07 15:54:26 +01:00
minimal-secure-streams-policy2c ip tos support 2021-02-04 10:28:02 +00:00
minimal-secure-streams-post ss: force check all set_metadata returns 2021-03-14 08:58:26 +00:00
minimal-secure-streams-proxy ss: sspc: add conmon performance telemetry 2021-04-05 10:55:04 +01:00
minimal-secure-streams-seq LE-root-cert-update 2021-01-13 04:32:13 +00:00
minimal-secure-streams-server ss: force check all set_metadata returns 2021-03-14 08:58:26 +00:00
minimal-secure-streams-server-raw type comparisons: fixes 2021-01-05 10:56:38 +00:00
minimal-secure-streams-sigv4 use gmtime_r instead of gmtime if possible 2021-03-25 10:08:40 +00:00
minimal-secure-streams-smd lws_metrics 2021-03-08 21:47:28 +00:00
minimal-secure-streams-staticpolicy lws_metrics 2021-03-08 21:47:28 +00:00
minimal-secure-streams-testsfail ss: force check all set_metadata returns 2021-03-14 08:58:26 +00: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