[Libwebsockets] Custom Header in websockets

Andy Green andy at warmcat.com
Fri Jun 3 14:38:49 CEST 2016

On 06/03/2016 08:31 PM, techi eth wrote:
> If i have some info in custom header then while calling lws_hdr_copy()
> function what will be the token index value.
> Ex : Header Key is TestLibWebsockets then what i need to pass while
> calling lws_hdr_copy.

It's not so simple... lws has a set of headers it understands and makes 
arrangements to decode.


headers outside that set (but it's a pretty comprehensive set) are ignored.

If you want to have lws parse a "custom header" (but is it really a good 
idea?) then you need to add to that list - at the end, before "" - and 
adapt this enum accordingly to match


After that, build and run minilex


and recook the library.

the answer to your question "what token index value" should be 
self-evident now.


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

More information about the Libwebsockets mailing list