my websocket works. wut up
This commit is contained in:
parent
60091012bf
commit
2b5cf0d265
1 changed files with 2 additions and 2 deletions
|
|
@ -15,10 +15,10 @@ module WebSocket
|
|||
|
||||
EventMachine::WebSocket.start(:host => "0.0.0.0", :port => 8080, :debug =>false) do |ws|
|
||||
ws.onopen {
|
||||
|
||||
puts ws.request['Cookie']
|
||||
sid = @channel.subscribe { |msg| ws.send msg }
|
||||
|
||||
ws.onmessage { |msg| @channel.push msg; puts msg}
|
||||
ws.onmessage { |msg| puts msg}#@channel.push msg; puts msg}
|
||||
|
||||
ws.onclose { @channel.unsubscribe(sid) }
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue