Skip to content
Simple websocket server with EventMachine
Latest commit 15e2fc0 Feb 1, 2011 @tuupola Add URI to test server.
Failed to load latest commit information.
config Deploy with Vlad. Jan 30, 2011
log Add quick and dirty README. Feb 1, 2011
README.textile Add URI to test server. Feb 1, 2011
Rakefile Deploy with Vlad. Jan 30, 2011
client2.html Initial commit. Dec 15, 2010
jquery.min.js Initial commit. Dec 15, 2010



To run the server do a git clone and run it from commandline. Server supports channels. When a channel receives a message it is broadcasted to all clients connected to that channel.

 > git clone git://
 > cd em-websocket-server
 > ruby server.rb

Then assuming you run the server at localhost you can connect from JavaScript with something like:

 var socket = new WebSocket("ws://localhost:8080/channel");

 socket.onopen = function(event) {

 socket.onmessage = function(event) {

 socket.onclose = function(event) {

If you want to do quick testing you can use:

 var socket = new WebSocket("ws://");
Something went wrong with that request. Please try again.