Can I use WsServer and WampServer on the same port?

35 views
Skip to first unread message

Andreas Goetz

unread,
Apr 28, 2016, 7:46:42 AM4/28/16
to Ratchet
I'm building a little hub&spoke architecture for distributing metering data. Currently, web clients subscribe to topics they're interested in using WAMP. For backend clients its desirable to allow simpler "naked" WebSocket connections without using WAMP, e.g. for use in node-red.

I'm already able to use Apache rules to distinguish HTTP(s) and WebSocket traffic on the same port which allows using ratchet over HTTPS.

Would it now be possible to run WAMP and naked WebSockets on the same port as well? So basically anything incoming that is not WAMP would be treated as "naked" WebSocket request.

How would such a server be initialized (any example welcome, maybe using the Router component)?

Cheers,
Andreas

Andreas Goetz

unread,
Apr 28, 2016, 8:06:42 AM4/28/16
to Ratchet
Answering my question here. Router does indeed look like a better starting point than technically using WS as WAMP fallback. Found this post which will help me to get started: https://groups.google.com/forum/#!topic/ratchet-php/L-X4GAVcaKQ

Much appreciated,
Andreas

Reply all
Reply to author
Forward
0 new messages