Authentication using Orbited, STOMP, and MorbidQ
I'm using Orbited to build a Comet chat system on a PHP-based website. However, currently any user can subscribe or post to any channel.
What I'm looking to do is have the browser listen for updates directly from the Orbited server, and have all other actions (subscribe, send) handled by a PHP authentication layer, which communicates wit开发者_如何学JAVAh Orbited via sockets. Is there a way to do this, or am I going to need a more robust messaging queue?
You can make the users subscribe to the individual channels.
Do the message posting through the PHP script (AJAX call), which will:
- check if the sender is authenticated
- post the message to the autenticated users (iterate over authenticated user list and send each user the message)
How to send the STOMP message from PHP? Use the PHP STOMP client.
If you are using MorbiQ, you should check out the RestQ plugin (http://www.morbidq.com/trac/wiki/RestQ).
精彩评论