Rails 的即时通讯工具实现? [英] instant messenger implementation for rails?

查看:43
本文介绍了Rails 的即时通讯工具实现?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我搜索了一些技术来为 ruby​​ on rails 应用程序构建一个简单的即时消息系统.这看起来非常复杂,因为我还没有发现任何跨浏览器的实现或任何 1-1 概念证明.

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.

调查:

  • xmpp 客户端(github 上有 Candy 只支持群聊)
  • xmpp 服务器和Rails(很多麻烦没有很好的集成)
  • Juggernaut(没有 1-1,Internet Explorer 不支持,因为使用了网络套接字)
  • ryan bates 的私人酒吧(似乎能够做到这一点,但作为 ruby​​ 新手,对此文档很少,无法理解这一点)

谁能给我推荐一个 Rails 的即时通讯工具:

  • 即跨浏览器
  • 有很好的文档,实现示例
  • Instant Messenger,其中用户 A 与用户 B 对话,用户 B 与用户 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

推荐答案

正如 Eric 所说,没有一个.发送消息是一件非常困难的事情.

As Eric said, there isn't one. Messaging is a very difficult thing to do.

现在我正在使用 Pubnub,这是一项外部服务.没有关于 Rails 集成的很好的文档,所以你只能尝试自己做.

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.

在更好的文档方面,有 Faye,但这是一个内部过程,需要两个实例运行(一个响应 Faye 请求,另一个运行您的应用程序).在 Heroku 上这样做有点棘手(而且成本更高),所以我只使用了 Pubnub.

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.

就 Faye 文档而言,请查看此 Railscast,并了解隐私,查看私人酒吧.

In terms of Faye documentation, check out this Railscast, and for privacy, check out Private Pub.

如果你认为 Private Pub 很难集成......好吧,不是刻薄,但也许你应该在深入研究这个问题之前尝试更多地了解 Rails 和 Javascript,因为这不是一件容易的事情(即使它看起来应该如此)

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)

编辑 2:另外,对于 faye,本教程可能会对您有所帮助.

edit 2: Also, for faye, this tutorial might help you out.

对于此类事情,您最好使用 Node.js.

You might be better off using Node.js for this type of thing.

这篇关于Rails 的即时通讯工具实现?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆