Sha256: e1f3194c76e99b132d6385b5a63ae420b243b160de89c981a0a02cef2a31e2c4

Contents?: true

Size: 270 Bytes

Versions: 2

Compression:

Stored size: 270 Bytes

Contents

require 'rubygems'
require 'em-websocket'

EventMachine::WebSocket.start(:host => "0.0.0.0", :port => 8080) do |ws|
  ws.onopen    { ws.send "Hello Client!"}
  ws.onmessage { |msg| p "got: #{msg}"; ws.send "Pong: #{msg}" }
  ws.onclose   { puts "WebSocket closed" }
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
em-http-request-0.2.10 examples/websocket-server.rb
em-http-request-0.2.9 examples/websocket-server.rb