[Libwebsockets] Using libwebsockets as a codec

Andy Green andy at warmcat.com
Tue Jun 9 16:02:45 CEST 2020



On 6/9/20 2:54 PM, Ganesh Murthy wrote:
> Our application has its own IO layer and is capable of providing 
> libwebsockets with raw byte buffers. Does lws have a pure codec mode 
> which takes in these buffers and produces http events that I can then go 
> on and use? This question was already asked 4 years ago here  - 
> https://libwebsockets.org/pipermail/libwebsockets/2016-November/002888.html
> 
> The closest I could find to an api that accepts buffers is 
> https://github.com/warmcat/libwebsockets/blob/master/include/libwebsockets/lws-adopt.h#L173 
> but I don't have access to file descriptors.

"Codec" means [en]coder/decoder it might mean something to you but it 
doesn't give me any picture of what you are talking about when you say 
that phrase wrt lws.

Do you mean perhaps lws "raw" protocol?  This just passes payload around 
without applying or removing any framing, eg

https://libwebsockets.org/git/libwebsockets/tree/minimal-examples/raw/minimal-raw-netcat

-Andy


More information about the Libwebsockets mailing list