I am trying to use websocket in my Rails4.1 application
Here are some relevant code snippets:
Gemfile:
gem 'websocket-rails' gem 'puma'
development.rb
config.middleware.delete Rack::Lock
I start the server locally as:
bundle exec puma -p 3000
In the chrome console, I see a connection error:
new WebSocketRails('localhost:3000/post/hello', true); WebSocket connection to 'ws://localhost:3000/post/hello' failed: Error during WebSocket handshake: Unexpected response code: 200
Can someone help with what I need to do to use network sockets locally in Rails?
Update1
I tried to add the following data according to websites that do not work in my Rails application when I start the Unicorn server but work on a thin server , but that did not help
Initializers / eventmachine.rb
Thread.new { EventMachine.run } unless EventMachine.reactor_running? && EventMachine.reactor_thread.alive
source share