Sha256: f7af2bdfe8ad6c36435d956da639ca77b0012fd7469cfffbe283ed2971d431bc

Contents?: true

Size: 338 Bytes

Versions: 3

Compression:

Stored size: 338 Bytes

Contents

require File.expand_path('../../lib/em-websocket', __FILE__)

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

3 entries across 3 versions & 1 rubygems

Version Path
em-websocket-0.3.8 examples/echo.rb
em-websocket-0.3.7 examples/echo.rb
em-websocket-0.3.6 examples/echo.rb