[Libwebsockets] Receiving multi-frame data as a libwebsocket server

Andy Green andy at warmcat.com
Tue Aug 19 02:52:58 CEST 2014

On 17 June 2014 04:14:52 GMT+08:00, Drew Noakes <drew at drewnoakes.com> wrote:
>I'm using libwebsockets as a server, and a browser at a client.
>Occasionally the client needs to send data to the server.
>Recently the size of this data jumped above 4096 bytes, and I'm now
>fragmentation on the server side.
>How can I detect whether data received in LWS_CALLBACK_RECEIVE should
>considered a continuation of data received previously? I tried
>calling libwebsocket_is_final_fragment(wsi) but this always returns
>I also tried observing the data in WireShark to see if Chrome's doing
>right thing, but the data appears to be hashed/obfuscated somehow.

Yeah websockets protocol calls for XORing a random key on each TX packet.

>It didn't appear to me as though the sample applications have this

Have a look at the fraggle test app.


>Libwebsockets mailing list
>Libwebsockets at ml.libwebsockets.org

More information about the Libwebsockets mailing list