mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-16 00:00:07 +01:00
![]() Adapt the pt sul owner list to be an array, and define two different lists, one that acts like before and is the default for existing users, and another that has the ability to cooperate with systemwide suspend to restrict the interval spent suspended so that it will wake in time for the earliest thing on this wake-suspend sul list. Clean the api a bit and add lws_sul_cancel() that only needs the sul as the argument. Add a flag for client creation info to indicate that this client connection is important enough that, eg, validity checking it to detect silently dead connections should go on the wake-suspend sul list. That flag is exposed in secure streams policy so it can be added to a streamtype with "swake_validity": true Deprecate out the old vhost timer stuff that predates sul. Add a flag LWS_WITH_DEPRECATED_THINGS in cmake so users can get it back temporarily before it will be removed in a v4.2. Adapt all remaining in-tree users of it to use explicit suls. |
||
---|---|---|
.. | ||
mount-origin | ||
CMakeLists.txt | ||
minimal-ws-proxy.c | ||
protocol_lws_minimal.c | ||
README.md |
lws minimal ws proxy
Build
$ cmake . && make
Description
This is the same as minimal-ws-server-ring, but with the inclusion of a ws client connection to https://libwebsockets.org using the dumb-increment protocol feeding the ringbuffer.
Each client that connect to this server receives the content that had arrived on the client connection feeding the ringbuffer proxied to their browser window over a ws connection.
Usage
$ ./lws-minimal-ws-proxy
[2018/03/14 17:50:10:6938] USER: LWS minimal ws proxy | visit http://localhost:7681
[2018/03/14 17:50:10:6955] NOTICE: Creating Vhost 'default' port 7681, 2 protocols, IPv6 off
[2018/03/14 17:50:10:6955] NOTICE: Using non-SSL mode
[2018/03/14 17:50:10:7035] NOTICE: created client ssl context for default
[2018/03/14 17:50:11:7047] NOTICE: binding to lws-minimal-proxy
[2018/03/14 17:50:11:7047] NOTICE: lws_client_connect_2: 0x872e60: address libwebsockets.org
[2018/03/14 17:50:12:3282] NOTICE: lws_client_connect_2: 0x872e60: address libwebsockets.org
[2018/03/14 17:50:13:8195] USER: callback_minimal: established
Visit http://localhost:7681 on multiple browser windows
Data received on the remote wss connection is copied to all open browser windows.
A ringbuffer holds up to 8 lines of text in the server, and the browser shows the last 20 lines of received text.