instant messenger implementation for rails?
Asked Answered
C

2

7

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

Canalize answered 21/2, 2012 at 19:0 Comment(0)
F
5

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.

Fablan answered 21/2, 2012 at 19:54 Comment(5)
Privatepub in itself is not that hard to setup the problem is in managing in the channels, basically having a room name for 2 people and subscribe_to them could work, perhaps I should digg more into it thx.Canalize
hi @Fablan thank you for this answer it help me a lot :) just one question : what do you means by requires two instances to be running ? i don't have a lot of experience with server setup thank youMonica
@medBo Basically, think about when you run rails server. When you do this normally, your computer gives up one thread of execution completely to that server -- you can't launch anything else in that terminal window while that process is running in the foreground. Heroku similarly doesn't allow you to launch another process to run something like Faye, or do background jobs, unless you pay for it.Fablan
thank you @Fablan i can understand now :) how much i should pay if i want lunch additional process ? is it expensive ?Monica
Approximately $15/month. Check out heroku.com/pricing. It's not that expensive when compared to other services out there such as Linode or EC2. Plus it saves you the hassle of all the other setup charges and whatnot. Depends what your time/money tradeoff is.Fablan
C
1

Work in progress: full facebook clone

https://github.com/rubytastic/im

please contribute the code is to be fixed and still wacky!

Canalize answered 11/9, 2012 at 22:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.