Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Basic app for peer to peer chat demo using html5 websocket and event machine

branch: master
Octocat-spinner-32 app updated layout February 02, 2011
Octocat-spinner-32 config added basic code February 02, 2011
Octocat-spinner-32 db added basic code February 02, 2011
Octocat-spinner-32 doc added basic code February 02, 2011
Octocat-spinner-32 lib added basic code February 02, 2011
Octocat-spinner-32 public added em_chat.rb February 02, 2011
Octocat-spinner-32 script added basic code February 02, 2011
Octocat-spinner-32 test added basic code February 02, 2011
Octocat-spinner-32 vendor added basic code February 02, 2011
Octocat-spinner-32 .gitignore added basic code February 02, 2011
Octocat-spinner-32 Gemfile added basic code February 02, 2011
Octocat-spinner-32 Gemfile.lock added basic code February 02, 2011
Octocat-spinner-32 README added readme February 02, 2011
Octocat-spinner-32 Rakefile added basic code February 02, 2011
Octocat-spinner-32 config.ru added basic code February 02, 2011
Octocat-spinner-32 em_chat.rb added em_chat.rb February 02, 2011
README
It is an basic app for peer to peer chat using event machine and websocket

You have to start server ruby em_chat.rb change location and port if you required
Now change in public/javascripts/em_chat.js same as modified url and port

This is developed for understanding html5 websocket and event machine.
In this there is some hack that connect if page is refresh
Process flow

After login there is one default web socket connection is establish for notifying user or maintaining session
It creates individual channel for each client


If user wants to chat it just click on user list then channel is establish betwwn them
if this user has active and channel is established
then notification is send to other user and message sends in queue
else
then notification send to sender user is not active
After acceptance of user whatever message in queue it push to all subscribe user

Here i dont know how much is reliable on production environment but you can check it out on local
and do changes as per requirement.






Something went wrong with that request. Please try again.