1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-16 00:00:07 +01:00
libwebsockets/minimal-examples/ws-server/minimal-ws-broker
2020-06-16 19:45:35 +01:00
..
mount-origin lws logo: update minimal examples 2020-03-06 04:46:39 +00:00
CMakeLists.txt cmake: provide LIBWEBSOCKETS_DEP_LIBS in CONFIG 2020-06-16 19:45:35 +01:00
minimal-ws-broker.c sul: all timed objects use a single pt sul list 2019-08-09 10:12:09 +01:00
protocol_lws_minimal.c cleaning 2020-01-05 22:17:58 +00:00
README.md minimal: ws-client-tx and change dir names to match project name 2018-04-06 10:38:03 +08:00

lws minimal ws broker

build

 $ cmake . && make

usage

 $ ./lws-minimal-ws-broker
[2018/03/15 12:23:12:1559] USER: LWS minimal ws broker | visit http://localhost:7681
[2018/03/15 12:23:12:1560] NOTICE: Creating Vhost 'default' port 7681, 2 protocols, IPv6 off

Visit http://localhost:7681 on multiple browser windows

The page opens a subscribe mode ws connection back to the broker, and a publisher mode ws connection back to the broker.

The textarea shows the data from the subscription connection.

If you type text is in the text box and press send, the text is passed to the broker on the publisher ws connection and sent to all subscribers.