1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-16 00:00:07 +01:00
libwebsockets/minimal-examples/http-server/minimal-http-server-sse-ring
Andy Green 6a6f365ce7 semmle: fix warnings
They're all cosmetic or minor js stuff.

Add related shield.io icons to README.
2019-09-22 09:35:07 -07:00
..
mount-origin semmle: fix warnings 2019-09-22 09:35:07 -07:00
CMakeLists.txt clean: internally use LWS_WITH_CLIENT and _SERVER 2019-08-26 09:58:57 +01:00
minimal-http-server-sse-ring.c sul: all timed objects use a single pt sul list 2019-08-09 10:12:09 +01:00
README.md minimal examples for Server Side Events 2018-04-20 07:15:42 +08:00

lws minimal http Server Side Events + ringbuffer

This demonstates serving both normal content and content over Server Side Events, where all clients see the same data via a ringbuffer.

Two separate threads generate content into the ringbuffer at random intervals.

build

 $ cmake . && make

usage

 $ ./lws-minimal-http-server-sse
[2018/04/20 06:09:56:9974] USER: LWS minimal http Server-Side Events + ring | visit http://localhost:7681
[2018/04/20 06:09:57:0148] NOTICE: Creating Vhost 'default' port 7681, 2 protocols, IPv6 off

Visit http://localhost:7681, which connects back to the server using SSE and displays the incoming data. Connecting from multiple browsers shows the same content from the server ringbuffer.