added socket to initializers

This commit is contained in:
maxwell 2010-06-20 22:04:49 -07:00
parent 3ce92c7c9d
commit 5b02597a05

View file

@ -0,0 +1,10 @@
require 'em-websocket'
require 'eventmachine'
EM.next_tick {
EventMachine::WebSocket.start(:host => "0.0.0.0", :port => 8080, :debug => true) do |ws|
ws.onopen { ws.send "Hello Client!"}
ws.onmessage { |msg| ws.send "Pong: #{msg}" }
ws.onclose { puts "WebSocket closed" }
end
}