[Libwebsockets] Does libwebsocket fit to my needs?

Alexander Eisenhuth ae at stacom-software.de
Thu Sep 4 14:04:18 CEST 2014

Thanks for the quick reply

>> Hello together,
>> before diving into libwebsockets, I want to figure out weather this lib
>> is what I'm looking for and fit into the architecture of my project.
>> I've to say that I'm no expert in Websockets, so forgive me about
>> "dumb
>> question".
>> I developed a component running under linux on x86 and arm11. The build
>> environment is gcc 4.7.2 an d cmake 2.8.
>> The application is a component behind a lighttpd web server. The client
>> uses JSON encoded HTTPS requests. These requests are passed with
>> mod_fcgi to my component, processed there and the answer send back as
>> JSON encoded answer. So far so good.
>> Now a new requirement is to send status data of the embedded device
>> asynchrously to clients. For that purpose Websockets shall be used.
>> Lighttpd doesn't support Websockets out of the box. There exists
>> mod_websocket, but it seems to be well supported.
>> So it looks like I've to integrate a new library supporting Websockets
>> into the am11/x86 platform.
>> Requirements:
>> - The idea is to start/stop the periodical delivery of status data with
>> a HTTPS/JSON Request
>> - Status data must be encrypted
>>   (ideally use the existing HTTPS connection of lighttpd)
>> - Footprint of the library must be low (~100KB ROM/RAM)
>> - Multiple client must be able to get the status data
> You should be able to do everything with lws and eliminate lighttpd.
> You can eliminate fcgi too and emit your json direct from lws user callback.
>> Questions:
>> - Can this be achieved using libwebsockets?
>> - How can that be done?
> Clone the git and build and study the test apps, particularly the test server.

Elimination lighttpd is unfortunately not possible. I must integrate the 
websocket lib in the existing architure.

So is it possible to expose a websocket interface (ws://<embedded 
device>/status) with the help  of lws.

What is the communication between clients and the websocket server?

What about ssl encryption?

More information about the Libwebsockets mailing list