我想使用的WebSocket在我的Rails4.1應用的WebSockets和Rails(彪馬) - WebSocket的握手過程中的錯誤:意外的響應代碼:200
這裏有一些相關的代碼片段:
的Gemfile:
gem 'websocket-rails'
gem 'puma'
development.rb
我在本地啓動服務器如:
bundle exec puma -p 3000
在Chrome控制檯我看到一個連接錯誤:
new WebSocketRails('localhost:3000/post/hello', true);
WebSocket connection to 'ws://localhost:3000/post/hello' failed: Error during WebSocket handshake: Unexpected response code: 200
誰能與我需要做的,在Rails的本地使用網絡套接字幫助嗎?
UPDATE1
我嘗試添加以下按Websockets not working in my Rails app when I run on Unicorn server, but works on a Thin server但它並沒有幫助
初始化/ eventmachine.rb
Thread.new { EventMachine.run } unless EventMachine.reactor_running? && EventMachine.reactor_thread.alive
理由downvote做什麼休息? – codeObserver
不是我的失望,但我會建議不要刪除'Rack :: Lock',除非你知道你在做什麼。 – XA21X