[Libwebsockets] question on websockets protocol name - required?

Michael Haberler mail17 at mah.priv.at
Mon Jan 6 22:19:36 CET 2014


Hi!

so far - looking at examples and being a websocket noob - I was under the impression one had to have a protocols struct with a websocket protocol name, requiring the client to send a "Sec-WebSocket-Protocol: <protocolname>" header

now I found this, which just gets away with a single http-only protocol entry:
https://github.com/otcshare/automotive-message-broker/blob/master/plugins/websocketsourceplugin/websocketsource.cpp

this would make it simpler for some clients which dont support a protocol name out of the box, like  https://pypi.python.org/pypi/websocket-client/ *)

question - assume I used this:

 can I still serve http and websockets from a single callback? 

 or would that force the scheme to serve only websockets?


thanks in advance,

Michael

*) it still does, just needs header=["Sec-WebSocket-Protocol: <protocolname>"] in the websocket.WebSocketApp() instantiation


More information about the Libwebsockets mailing list