I am attempting to deploy a Ruby on Rails application that is being served via Thin. The application uses websockets, specifically the websocket-rails library.
This works locally. When attempting to deploy, it does not work. The websocket server is not a standalone application - the websockets are simply part of the main application server. When my javascript creates a connection to the webserver, I see the following in my production.log:
[2014-11-02T23:38:19.942236 #9154] INFO -- : Started GET "/websocket" for <IP ADDRESS> at 2014-11-02 23:38:19 +0000
There is nothing else related to the websocket request in production.log. In my websocket_rails.log, I see:
[32mConnectionManager^[[0m] Connection opened: #<Connection::b2b0d6b0e3faa4432b0c>
[32mConnectionManager^[[0m] Connection closed: #<Connection::b2b0d6b0e3faa4432b0c>
Showing that the request did reach the websocket code, and the connection was promptly closed. In the browser, I see the
WebSocket connection to 'ws:/<DOMAIN>/websocket' failed: Error during WebSocket handshake: Unexpected response code: 200
I have found very limited information regarding this error. Is there an easy way to debug these errors? Inspecting the data in Chrome Inspector shows the following for the request to /websocket:
I'd like to think I'm missing a simple configuration but have to discover what that might be. Any ideas?
Thanks!