Socket.io and eventmachine in ruby?

You client code is trying to connect to a server using the websockets protocol. However, your server code isn't accepting websockets connections - it's only doing HTTP One option is to use the event machine websockets plugin: https://github. Com/igrigorik/em-websocket EventMachine.

Run { EventMachine::WebSocket. Start(:host => "0.0.0.0", :port => 8080) do |ws| ws. Onopen { puts "WebSocket connection open" # publish message to the client ws.

Send " Onclose { puts "Connection closed" } ws. Onmessage { |msg| puts "Recieved message: #{msg}" ws. Send "Pong: #{msg}" } end }.

You client code is trying to connect to a server using the websockets protocol. However, your server code isn't accepting websockets connections - it's only doing HTTP. One option is to use the event machine websockets plugin: https://github.Com/igrigorik/em-websocket EventMachine.

Run { EventMachine::WebSocket. Start(:host => "0.0.0.0", :port => 8080) do |ws| ws. Onopen { puts "WebSocket connection open" # publish message to the client ws.

Send " Onclose { puts "Connection closed" } ws. Onmessage { |msg| puts "Recieved message: #{msg}" ws. Send "Pong: #{msg}" } end }.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions