title: How to debug 'Invalid frame header' Websocket issues with Rails/websocket-rails (standalone)
body: <p>I'm getting started with websocket-rails, trying to convert an old polling system for notifications (on Ruby 2.1/Rails 4.0) to something a bit more modern with WS. I'm using WebsocketRails in standalone mode, here is my configuration, basically, the default:</p>
  <pre><code>WebsocketRails.setup do |config|
     config.standalone = true
  end
  </code></pre>
  <p>I have also setup a fresh Redis running on the default port - there seems to be no communication issues here.</p>
  <p>On the client side, I have added the websocket-rails's JS and when trying to open an connection and subscribe to a channel, with:</p>
  <pre><code>@dispatcher = new WebSocketRails &quot;localhost:3001/websocket&quot;
  @channel = @dispatcher.subscribe &quot;notifications&quot;
  </code></pre>
  <p>I see an error in the Chrome console:</p>
  <pre><code>WebSocket connection to 'ws://localhost:3001/websocket' failed: Invalid frame header 
  </code></pre>
  <p>In Firefox, the error is different but still an error:</p>
  <pre><code>The connection to ws://localhost:3001/websocket was interrupted while the page was loading.
  </code></pre>
  <p>From the websocket server logs, I can see that a connection has been initiated and then dropped, but there are no other logs, even tho log level is &quot;debug&quot;... There are no other errors that I can see and a cursory Google search doesn't bring up anything regarding &quot;invalid frame header&quot;, so I'm pretty much stuck.</p>
  <p>Any help would be appreciated!</p>
  <p><strong>EDIT:</strong> I ended up using NodeJS+Faye to get things moving, and it has been working so well that I'm happy to introduce this new moving part in the system. I'm sure the issue was just something <em>temporary</em> based on my specific setup but sometimes, you just have to get things done.</p>