Last active
December 16, 2015 03:19
-
-
Save RohitRox/5369168 to your computer and use it in GitHub Desktop.
one-to-one websockets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EventMachine.run do | |
EM::WebSocket.start(:host => "0.0.0.0", :port => 8080, :debug => false) do |ws| | |
ws.onopen do | |
ws.onmessage { |data| | |
# ... | |
# ws.send | |
} | |
ws.onclose { |data| | |
# ... | |
# ws.send | |
} | |
end | |
end | |
puts "EM Websocket started at port 8080" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment