Rails 的即时通讯实现?
我花了一些时间研究几种技术来为 ruby on Rails 应用程序构建一个简单的即时消息系统。这看起来非常复杂,因为我还没有找到任何跨浏览器的实现或任何 1-1 概念证明。
研究:
- xmpp客户端(github上有Candy只支持群聊)
- xmpp服务器和xmpp服务器Rails(很多麻烦,没有很好的集成)
- Juggernaut(没有 1-1,由于使用了 Web 套接字,Internet Explorer 不支持)
- Private Pub by ryan bates(似乎能够做到这一点,但作为 ruby 新手,对此几乎没有文档无法弄清楚)
谁能给我推荐一个 Rails 即时通讯工具:
- ,即跨浏览器
- 有很好的文档,即时通讯的实现示例,
- 其中用户 A 与用户 B 对话,用户 B 对话对于用户A,
我真的不知道如何实现这个,任何人都可以给我关于如何解决这个问题的建议吗?谢谢
I have searched for some time investigating several technologies to build an simple instant messaging system for a ruby on rails app. It seems very complicated as I haven't found any implementations that are cross browser or any 1-1 proof of concept at all.
Looked into:
- xmpp clients ( there is Candy on github only supports group chat )
- xmpp servers & Rails ( lot of hassle no good integration )
- Juggernaut ( no 1-1 , not supported by Internet Explorer cause of web sockets used)
- Private Pub by ryan bates ( seems to be able to do the trick but as ruby newbie with little documentation on this cannot get this figured )
Can anyone suggest me a instant messenger for rails:
- that is Cross browser
- has good documentation, example of implementation
- Instant Messenger where User A talks to User B and User B talks to User A
I really have no idea anymore how I would implement this, anyone can give me advise on how this problem could be tackled? thx
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
正如埃里克所说,没有。消息传递是一件非常困难的事情。
现在我正在使用 Pubnub,这是一项外部服务。目前还没有关于 Rails 集成的很好的文档,因此您只能尝试自己进行操作。
在更好的文档方面,有 Faye,但这是一个内部进程,需要运行两个实例(一个响应 Faye 请求,以及运行您的应用程序)。在 Heroku 上做这件事有点棘手(而且更昂贵),所以我只是坚持使用 Pubnub。
就 Faye 文档而言,请查看此 Railscast,而对于隐私,请查看私人酒吧。
编辑:如果您认为 Private Pub 很难集成..好吧,不是故意的,但也许您应该在深入研究这个问题之前尝试了解有关 Rails 和 Javascript 的更多信息,因为它不是一个做起来很容易(尽管看起来应该如此)
编辑 2: 另外,对于 faye,本教程可能会对您有所帮助。
对于此类事情,您可能最好使用 Node.js。
As Eric said, there isn't one. Messaging is a very difficult thing to do.
Right now I'm using Pubnub, which is an external service. There isn't very good documentation on Rails integration, so you'll just have to try to do it yourself.
On the better documented side, there's Faye, but this is an internal process and requires two instances to be running (one to respond to Faye requests, and one to run your app). This was a little trickier (and more expensive) to do on Heroku, so I just stuck to Pubnub.
In terms of Faye documentation, check out this Railscast, and for privacy, check out Private Pub.
edit: if you think Private Pub is hard to integrate.. well, not to be mean, but perhaps you should try to learn more about Rails and Javascript before you delve into this matter, as it's not an easy thing to do (even though it seems like it should be)
edit 2: Also, for faye, this tutorial might help you out.
You might be better off using Node.js for this type of thing.
正在进行的工作:
完整的 Facebook 克隆,
请贡献代码,待修复,但仍然很古怪!
Work in progress:
full facebook clone
please contribute the code is to be fixed and still wacky!