I am newly learning Rails and playing with Web Chat app. I looked
through what other people have done. I tested the following very
naive, skeleton app. It seems to work in my local machine when I open
two Firefox (or two Safari). But it does not work cross browser, eg,
Firefox-Safari. Strange? What’s going on? Thanks.
I would recommend going against the Rails option here as you’re making a
request at least once every second to an action in your application.
Imagine if 10 people were in the chat, that would mean 10 requests per
second.
Think of an alternative option here, like an IRC server or similar.
I would recommend going against the Rails option here as you’re
making a
request at least once every second to an action in your application.
Imagine if 10 people were in the chat, that would mean 10 requests per
second.
Think of an alternative option here, like an IRC server or similar.
Campfire does it, so it does work when done right.
You could have a look at juggernaut, does use a flash file and extra
process running on the server.
And a third from me. I met the developer of Juggernaut at RailsConf
and saw a demo. Very slick. It uses a small flash object to keep a
persistent connection open between client and server so you eliminate
a lot of issues there. From a development perspective it was
basically as simple as saying “open chat channel 9” (work out the
details for your app) and then the client/browser just listens.
Another option, if you’re shopping, is Jabber. I was leaning towards
this until I ran into Juggernaut.
Yea just wanted to second the juggernaut option. I am using it and it
works great.
Posted viahttp://www.ruby-forum.com/.
Jabber is a communication protocol. You’ll still need a Comet
(official term) implementation like Juggernaut to push chats out to
the user or do polling like Gmail’s in-browser chat client does
(IIRC),
That is using a more standard comet implementation called shooting_star.
Like Juggernaut, it opens a persistent connection which can be used for
implementing a chat system.
I have looked at both and I chose Juggernaut but it easily could have
been the wrong decision. However, juggernaut was so easy to use and it
worked so I had no reason to move away from it. As long as the browser
has Flash, it works like a charm.
Thank you all for great suggestions! In fact, I installed Juggernat
today.
I followed its README file example included below. It works, but
whenever Rails call is made, alert window ( "Juggernaut: Received
data:
try { … " ) pops up all the time. How can I block this?
-chat controller:
class ChatController < ApplicationController
def index
end
def send_data
render :juggernaut do |page|
page.insert_html :top, ‘chat_data’, “
Yea, I get that too. It only happens in development (on your local PC).
It is for your debugging purposes. Once deployed to the server, these
messages are not displayed. (Make sure on the server, the juggernaut
config file is set to production mode).