I'm starting with websocket-rails, trying to convert the old notification polling system (on Ruby 2.1 / Rails 4.0) into something more modern with WS. I use WebsocketRails in standalone mode, here is my configuration, basically by default:
WebsocketRails.setup do |config| config.standalone = true end
I also installed the new Redis on the default port - there seems to be no transfer problems here.
On the client side, I added websocket-rails JS and when trying to open a connection and subscribe to the channel using:
@dispatcher = new WebSocketRails "localhost:3001/websocket" @channel = @dispatcher.subscribe "notifications"
I see an error on the Chrome console:
WebSocket connection to 'ws://localhost:3001/websocket' failed: Invalid frame header
In Firefox, the error is different, but still the error:
The connection to ws:
From the websocket server logs, I see that the connection was initiated and then deleted, but there are no other logs, even if the log level is "debug" ... There are no other errors that I can see and a quick Google search does not cause anything about an "invalid frame header "so I'm pretty stuck.
Any help would be appreciated!
EDIT: I ended up using NodeJS + Faye so that everything is in order and it works so well that I am pleased to introduce this new moving part to the system. I'm sure the problem was something temporary, based on my specific setup, but sometimes you just need to do everything.
ruby ruby-on-rails websocket
Enders
source share