开发者

Using ejabberd with Rails

开发者 https://www.devze.com 2023-02-21 17:59 出处:网络
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 authentic

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:

  1. Does this architecture make sense or is there something in it that's not doable?
  2. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号