[Libwebsockets] lwsws build on linux mint 20.1
andy at warmcat.com
Tue Jul 6 06:03:22 CEST 2021
On 7/6/21 4:39 AM, Steve Calfee wrote:
> Thanks, That made it build. But first I tried cmake from the wrong
> directory somewhere and the include directory was deleted. That broke
> the build fast. However, "git restore include" fixed that back and now
> the build works.
That's why the general advice is like
mkdir build; cd build; cmake ..
you can always rm -rf build and be sure nothing was touched in the sources.
> I have now come around to thinking that lwsws is the way to go for all
> but the smallest systems. I am trying to get one of the test apps built,
> it is not clear how to start and add new lwsws apps, but maybe that will
> get clearer as I try.
Lwsws approach is remove all the boilerplate and use JSON config files
to define options, vhosts and http mounts to place different things into
the same vhost url space. If you just need to serve files, or proxy
other services, or run cgis, it can do it without any other pieces.
For example, everything on https://libwebsockets.org is served by lwsws.
That includes the toplevel pages, but also
https://libwebsockets.org/git which reverse-proxies gitohashi (a
separate process communicating with lwsws over a unix domain socket) and
https://libwebsockets.org/sai which is the same situation with a
different process. (Both gitohashi and sai in turn use lws and JSON
config in their process to manage their unix domain socket). The
mailing list web interface is served by lwsws with mailman as a cgi. So
these are ways to bind other processes into lwsws and compose them into
a vhost URL space essentially by reverse-proxying.
If you need ws protocol serving, you can build lws plugins to implement
whatever it is you want, and enable the plugin's protocol on to specific
vhosts in the lwsws JSON config. You can also define pvos (per-vhost
options) for each protocol in the JSON, to configure the plugins for
each vhost that binds to them.
https://libwebsockets.org/testserver presents several example plugin
protocols via lwsws that way.
There's a template standalone-buildable plugin here
More information about the Libwebsockets