[Libwebsockets] Q on protocol names

Andy Green andy at warmcat.com
Sun Aug 10 04:01:40 CEST 2014



On 10 August 2014 04:36:42 GMT+08:00, Michael Haberler <mail17 at mah.priv.at> wrote:
>
>I'd like to have a single protocols structure, since I have a single
>callback only anyway, which cover http/s and ws/s
>
>Ideally I'd inspect the ws protcol name the client desired, and upgrade
>to _that_ protocol, set an option in my private session structure (or
>deny altogether, modulo on protocol name)
>
>is that something I could do? how?

I'll study your patch for it, but is this actually something that needs doing with dynamic protocol names in the user code?

I don't know what your use-case is but don't forget there is a URL part also coming with the ws upgrade action, that can be used to refine the meaning of that websocket connection.

Because protocols themselves mandate specific code support that either exists in the server / client or not, handling them as static definitions seems more natural...

-Andy

>
>thanks,
>- Michael
>
>since I just noted
>https://github.com/warmcat/libwebsockets/commit/a40760a2de74204c0c845315339b4613ce0bb439
>- 
>assuming a NULL protocol name on the first and only protocol structure,
>would that accept _any_ protocol name the client specified? my first
>attempt with a single NULL protocol name got me a busily looping
>server..
>
>
>
>_______________________________________________
>Libwebsockets mailing list
>Libwebsockets at ml.libwebsockets.org
>http://ml.libwebsockets.org/mailman/listinfo/libwebsockets




More information about the Libwebsockets mailing list