I'm trying to create a chat component to add to an existing Rails web app (and perhaps optimize communication with clients along the way). The architecture I was thinking of is: when a user authenticates on Rails, create his/her Jabber credentials and set them in JS on page load. Use ejabberd to accept flash TCP or BOSH (probably using jquery-bosh) connections from clients, connect Rails to ejabberd (as a regular client) using xmpp4r and look at messages from clients as they come. If they're app-specific messages, do the relevant action, if they're user-to-user messages, pass them to the appropriate user/group. At the same time, continue to开发者_运维技巧 use Thin/Apache to serve the regular webpages.
I have a couple of questions:
- Does this architecture make sense or is there something in it that's not doable?
- Besides the ejabberd documentation and xmpp4r documentation, which I'm currently going through, are there any other resources you could point me to that might be of interest?
Thank you.
精彩评论