1d4afb5ceSopenharmony_ci# lws minimal http server eventlib
2d4afb5ceSopenharmony_ci
3d4afb5ceSopenharmony_ciWARNING: this is under development, it's not stable.
4d4afb5ceSopenharmony_ci
5d4afb5ceSopenharmony_ciThis demonstrates a minimal http server that can use any of the event libraries
6d4afb5ceSopenharmony_ci
7d4afb5ceSopenharmony_ciCommandline option|Meaning
8d4afb5ceSopenharmony_ci---|---
9d4afb5ceSopenharmony_ci-d <loglevel>|Debug verbosity in decimal, eg, -d15
10d4afb5ceSopenharmony_ci-t <threads>|Number of threads to use.
11d4afb5ceSopenharmony_ci--uv|Use the libuv event library (lws must have been configured with `-DLWS_WITH_LIBUV=1`)
12d4afb5ceSopenharmony_ci--event|Use the libevent library (lws must have been configured with `-DLWS_WITH_LIBEVENT=1`)
13d4afb5ceSopenharmony_ci--ev|Use the libev event library (lws must have been configured with `-DLWS_WITH_LIBEV=1`)
14d4afb5ceSopenharmony_ci
15d4afb5ceSopenharmony_ci## build
16d4afb5ceSopenharmony_ci
17d4afb5ceSopenharmony_cililbwebsockets must have been built with `LWS_MAX_SMP` greater than 1 to use
18d4afb5ceSopenharmony_cimultiple threads.
19d4afb5ceSopenharmony_ci
20d4afb5ceSopenharmony_ci```
21d4afb5ceSopenharmony_ci $ cmake . && make
22d4afb5ceSopenharmony_ci```
23d4afb5ceSopenharmony_ci
24d4afb5ceSopenharmony_ci## usage
25d4afb5ceSopenharmony_ci
26d4afb5ceSopenharmony_ci```
27d4afb5ceSopenharmony_ci $ ./lws-minimal-http-server-eventlib-smp
28d4afb5ceSopenharmony_ci[2018/03/04 09:30:02:7986] USER: LWS minimal http server-eventlib | visit http://localhost:7681
29d4afb5ceSopenharmony_ci[2018/03/04 09:30:02:7986] NOTICE: Creating Vhost 'default' port 7681, 1 protocols, IPv6 on
30d4afb5ceSopenharmony_ci```
31d4afb5ceSopenharmony_ci
32d4afb5ceSopenharmony_ciVisit http://localhost:7681
33d4afb5ceSopenharmony_ci
34