Sha256: 5dabefd79acf1c64a4ebc7c102b14be53778a3ab4a297d13d8a79d13afff1acd

Contents?: true

Size: 303 Bytes

Versions: 7

Compression:

Stored size: 303 Bytes

Contents

require 'lib/em-websocket'

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" }
  ws.onerror   { |e| puts "Error: #{e.message}" }
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
sonixlabs-em-websocket-0.3.8 examples/echo.rb
sonixlabs-em-websocket-0.3.7 examples/echo.rb
em-websocket-0.3.5 examples/echo.rb
em-websocket-0.3.2 examples/echo.rb
em-websocket-0.3.1 examples/echo.rb
em-websocket-0.3.0 examples/echo.rb
em-websocket-0.2.1 examples/echo.rb