1d4afb5ceSopenharmony_ci# lws minimal ws client SPAM
2d4afb5ceSopenharmony_ci
3d4afb5ceSopenharmony_ciThis connects to libwebsockets.org using the lws-mirror-protocol.
4d4afb5ceSopenharmony_ci
5d4afb5ceSopenharmony_ciBy default is has 10 concurrent connections and connects 100 times.
6d4afb5ceSopenharmony_ci
7d4afb5ceSopenharmony_ci## build
8d4afb5ceSopenharmony_ci
9d4afb5ceSopenharmony_ci```
10d4afb5ceSopenharmony_ci $ cmake . && make
11d4afb5ceSopenharmony_ci```
12d4afb5ceSopenharmony_ci
13d4afb5ceSopenharmony_ci## Commandline Options
14d4afb5ceSopenharmony_ci
15d4afb5ceSopenharmony_ciOption|Meaning
16d4afb5ceSopenharmony_ci---|---
17d4afb5ceSopenharmony_ci-d|Set logging verbosity
18d4afb5ceSopenharmony_ci--server|Use a specific server instead of libwebsockets.org, eg `--server localhost`.  Implies LCCSCF_ALLOW_SELFSIGNED
19d4afb5ceSopenharmony_ci--port|Use a specific port instead of 443, eg `--port 7681`
20d4afb5ceSopenharmony_ci-c|Amount of concurrent connections
21d4afb5ceSopenharmony_ci-l|Test limit (total number of connections to make)
22d4afb5ceSopenharmony_ci
23d4afb5ceSopenharmony_ci## usage
24d4afb5ceSopenharmony_ci
25d4afb5ceSopenharmony_ciJust run it, it will repeatedly connect and reconnect to libwebsockets.org
26d4afb5ceSopenharmony_ciuntil it hits the test limit.
27d4afb5ceSopenharmony_ci
28d4afb5ceSopenharmony_ciYou can also direct it to use the lws test server in tls mode by running that
29d4afb5ceSopenharmony_ciwith `libwebsockets-test-server -s` and running this using, eg
30d4afb5ceSopenharmony_ci
31d4afb5ceSopenharmony_ci```
32d4afb5ceSopenharmony_ci $ ./lws-minimal-ws-client-spam -c 20 -l 200 --server localhost --port 7681
33d4afb5ceSopenharmony_ci```
34d4afb5ceSopenharmony_ci
35d4afb5ceSopenharmony_ci```
36d4afb5ceSopenharmony_ci $ ./lws-minimal-ws-client-spam
37d4afb5ceSopenharmony_ci[2018/11/15 09:53:19:9639] USER: LWS minimal ws client SPAM
38d4afb5ceSopenharmony_ci[2018/11/15 09:53:19:9647] NOTICE: Creating Vhost 'default' (serving disabled), 1 protocols, IPv6 off
39d4afb5ceSopenharmony_ci[2018/11/15 09:53:19:9695] NOTICE: created client ssl context for default
40d4afb5ceSopenharmony_ci[2018/11/15 09:53:21:0976] USER: callback_minimal_spam: established (try 10, est 0, closed 0, err 0)
41d4afb5ceSopenharmony_ci[2018/11/15 09:53:21:1041] USER: callback_minimal_spam: established (try 10, est 1, closed 0, err 0)
42d4afb5ceSopenharmony_ci[2018/11/15 09:53:21:1089] USER: callback_minimal_spam: established (try 10, est 2, closed 0, err 0)
43d4afb5ceSopenharmony_ci[2018/11/15 09:53:21:1132] USER: callback_minimal_spam: established (try 10, est 3, closed 0, err 0)
44d4afb5ceSopenharmony_ci[2018/11/15 09:53:21:1166] USER: callback_minimal_spam: established (try 10, est 4, closed 0, err 0)
45d4afb5ceSopenharmony_ci[2018/11/15 09:53:21:1531] USER: callback_minimal_spam: established (try 10, est 5, closed 0, err 0)
46d4afb5ceSopenharmony_ci[2018/11/15 09:53:21:1563] USER: callback_minimal_spam: established (try 10, est 6, closed 0, err 0)
47d4afb5ceSopenharmony_ci[2018/11/15 09:53:21:1589] USER: callback_minimal_spam: established (try 10, est 7, closed 0, err 0)
48d4afb5ceSopenharmony_ci[2018/11/15 09:53:21:1616] USER: callback_minimal_spam: established (try 10, est 8, closed 0, err 0)
49d4afb5ceSopenharmony_ci[2018/11/15 09:53:21:1671] USER: callback_minimal_spam: established (try 10, est 9, closed 0, err 0)
50d4afb5ceSopenharmony_ci[2018/11/15 09:53:21:3778] USER: callback_minimal_spam: reopening (try 11, est 10, closed 1, err 0)
51d4afb5ceSopenharmony_ci...
52d4afb5ceSopenharmony_ci```
53d4afb5ceSopenharmony_ci
54