Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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:

WebsocketRails.setup do |config|
   config.standalone = true
end

I have also setup a fresh Redis running on the default port - there seems to be no communication issues here.

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:

   @dispatcher = new WebSocketRails "localhost:3001/websocket"
   @channel = @dispatcher.subscribe "notifications"

I see an error in the Chrome console:

  WebSocket connection to 'ws://localhost:3001/websocket' failed: Invalid frame header 

In Firefox, the error is different but still an error:

  The connection to ws://localhost:3001/websocket was interrupted while the page was loading.

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 "debug"... There are no other errors that I can see and a cursory Google search doesn't bring up anything regarding "invalid frame header", so I'm pretty much stuck.

Any help would be appreciated!

EDIT: 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 temporary based on my specific setup but sometimes, you just have to get things done.

share|improve this question
    
What webserver are you using? I'm using faye-websocket on thin and I'm in exactly the same situation. –  itdoesntwork Dec 22 '14 at 2:53
    
It's running on Thin. I have since then upgraded to Rails 4.1 and Ruby 2.1.5 after the security updates and haven't had a chance to try again, I am hoping for a christmas miracle. I have looked around and couldn't find much about the issue so I assume it's just an artifact due to a very unlikely combination of elements. –  Enders Dec 23 '14 at 1:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.