= EM-WebSocket EventMachine based WebSocket server -- highly experimental, at this point, at least. - http://www.igvita.com/2009/12/22/ruby-websockets-tcp-for-the-browser/ == Simple server example EventMachine.run { EventMachine::WebSocket.start(:host => "0.0.0.0", :port => 8080) do |ws| ws.onopen { puts "WebSocket connection open" # publish message to the client ws.send "Hello Client" } ws.onclose { puts "Connection closed" } ws.onmessage { |msg| puts "Recieved message: #{msg}" ws.send "Pong: #{msg}" } end }