[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...


>- Michael
>since I just noted
>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
>Libwebsockets mailing list
>Libwebsockets at ml.libwebsockets.org

More information about the Libwebsockets mailing list