Skip to content

A simple real time chat application powered by sinatra and websockets

Notifications You must be signed in to change notification settings

robe5/websockets-chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a simple real time application powered by Sinatra + EventMachine + Websockets. Websockets is an HTML5 feature so this will only work in a modern browser like Google Chrome.

Installing the application

git clone git@github.com:robe5/websockets-chat.git
gem install bundler
bundle install

Running the server

rackup config.ru

This app has been tested with Ruby 1.9.2.

Protocol

User connected

Client:

['user_connected',
  { name: "Jose" }
]

Server:

['user_connected',
  { name, "Jose",
    users: ['Jose', 'Juan']
  }
]

User message

Client:

['user_message',
  { message: 'the text' }
]

Server:

['user_message',
  { name: 'Jose',
    message: 'the text'
  }
]

User disconnected

Server

['user_disconnected',
  { name:null
    message: 'disconnected',
    'users': ['Jose']
   }
]

About

A simple real time chat application powered by sinatra and websockets

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published