[Libwebsockets] v2.0 coming very soon

Thomas Spitz thomas.spitz at hestia-france.com
Tue May 17 18:23:21 CEST 2016

Everything works fine with lwsws top level function.

This has shown me several interesting functions I would like to use but
without activating libev/libuv (I am on a restricted resources embedded
system) and without implementation new plugin approach (I am the only one
using lws):
- Redirect certain http port to https port
- Use cgi (namely cgitest)
- mountpoint to different system folder (egg: server-status redirects to

I suppose that the above functions are not tied to lwsws but I managed to
make it work neither with ./libwebsockets-test-server nor with
./libwebsockets-test-server-v2.0 (plugin activated)
All other functions are working (Dumb Increment Demo, Mirror demo, close
testing, server info, post).

By the way:
- is it possible (easily) to restrict access (ask for login/pwd) for some
files/folders retrieved by HTTP like Apache do with .htpasswd?

- I have seen "Lws platform-independent file access apis" but is it usable
with any third party websocket client library? I suppose not...

Sorry for so many general questions.

Best regards,

2016-05-17 16:05 GMT+02:00 Andy Green <andy at warmcat.com>:

> On May 17, 2016 9:29:07 PM GMT+08:00, Andy Green <andy at warmcat.com> wrote:
> >
> >
> >On May 17, 2016 8:43:15 PM GMT+08:00, Thomas Spitz
> ><thomas.spitz at hestia-france.com> wrote:
> >>Everything work fine except cgitest (the test you explained here :
> >>https://libwebsockets.org/pipermail/libwebsockets/2016-March/002253.html
> )
> >
> >Right, but I didn't put cgitest in the conf.d example.
> >
> >If I understood it, you can reproduce the conf.d example as it is fine.
> I added the test cgi script to the example localhost config at /testcgi.
> The test script issues headers to set the output to text/html and then
> sends a html table of /proc/meminfo.
> Managing spawned cgis has a quirk, to make it work reliably the server
> process is detached from the controlling terminal when spawning the cgi.
> If you run lwsws in daemon mode, which is how the systemd integration
> works, that doesn't make a problem and everything is normal.  But if not,
> it means after running the cgi, ^C from the controlling tty won't reach
> lwsws.  It's not that lwsws ignores it, it's not attached to the terminal
> any more in a way that receives the signal.
> You can send it a SIGINT another way, like sudo killall -SIGINT lwsws and
> it will close fine.  But if you're planning on using cgi, you should run
> lwsws as a daemon.
> There's example systemd integration provided
> https://github.com/warmcat/libwebsockets/blob/master/lwsws/usr-lib-systemd-system-lwsws.service
> -Andy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20160517/7bd5590a/attachment-0001.html>

More information about the Libwebsockets mailing list