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-client/minimal-ws-client-rx
Andy Green 0fb976837b tls certs: update warmcat.com and libwebsockets.org public certs
Old certs were getting near the end of their life and we switched the
server to use letsencrypt.  The root and intermediate needed for the
mbedtls case changed accordingly
2019-09-22 03:08:36 -07:00
..
CMakeLists.txt clean: internally use LWS_WITH_CLIENT and _SERVER 2019-08-26 09:58:57 +01:00
libwebsockets.org.cer tls certs: update warmcat.com and libwebsockets.org public certs 2019-09-22 03:08:36 -07:00
minimal-ws-client.c sul: all timed objects use a single pt sul list 2019-08-09 10:12:09 +01:00
README.md minimal: ws-client-tx and change dir names to match project name 2018-04-06 10:38:03 +08:00
selftest.sh selftests 2018-04-19 16:16:48 +08:00

lws minimal ws client rx

build

 $ cmake . && make

usage

The application goes to https://libwebsockets.org and makes a wss connection using the dumb-increment-protocol. It shows the incrementing number it is being sent over ws as it arrives.

This example only receives things to keep it simple. See minimal-ws-client-tx for code related to sending things. Of course rx and tx are supported in the same protocol.

./lws-minimal-ws-client-rx
[2018/03/14 11:57:24:0689] USER: LWS minimal ws client rx
[2018/03/14 11:57:24:0705] NOTICE: Creating Vhost 'default' port -1, 1 protocols, IPv6 off
[2018/03/14 11:57:24:0710] NOTICE: created client ssl context for default
[2018/03/14 11:57:24:0788] NOTICE: lws_client_connect_2: 0x15b8310: address libwebsockets.org
[2018/03/14 11:57:24:7643] NOTICE: lws_client_connect_2: 0x15b8310: address libwebsockets.org
[2018/03/14 11:57:26:9191] USER: RX: 0
[2018/03/14 11:57:26:9318] USER: RX: 1
[2018/03/14 11:57:27:2182] USER: RX: 2
[2018/03/14 11:57:27:2336] USER: RX: 3
[2018/03/14 11:57:27:2838] USER: RX: 4
[2018/03/14 11:57:27:5173] USER: RX: 5
[2018/03/14 11:57:27:5352] USER: RX: 6
[2018/03/14 11:57:27:5854] USER: RX: 7
[2018/03/14 11:57:27:8156] USER: RX: 8
[2018/03/14 11:57:27:8359] USER: RX: 9
^C[2018/03/14 11:57:27:9884] USER: Completed