[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:
>Hi,
>
>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
>seeing
>fragmentation on the server side.
>
>How can I detect whether data received in LWS_CALLBACK_RECEIVE should
>be
>considered a continuation of data received previously? I tried
>calling libwebsocket_is_final_fragment(wsi) but this always returns
>true.
>
>I also tried observing the data in WireShark to see if Chrome's doing
>the
>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
>functionality.

Have a look at the fraggle test app.

-Andy

>Thanks,
>
>Drew
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Libwebsockets mailing list
>Libwebsockets at ml.libwebsockets.org
>http://ml.libwebsockets.org/mailman/listinfo/libwebsockets




More information about the Libwebsockets mailing list