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