Reputation: 3174
I'm trying to get action cable to work and I'm getting the error
WebSocket connection to 'ws://cloud9workspace:3000/cable' failed: WebSocket is closed before the connection is established.
I've looked all over google and can't find anything that works. I did add line 3 to my config.ru because someone on Cloud9 community said they tried it and it worked. It didn't work for me though.
require ::File.expand_path('../../config/environment', __FILE__)
Rails.application.eager_load!
ActionCable.server.config.disable_request_forgery_protection = true
run ActionCable.server
I am using a pro workspace on cloud9 but I haven't seen anything that indicates cloud9 to be the issue. I've been stuck on this for a while now. Any help would be appreciated!
Upvotes: 4
Views: 2793
Reputation: 352
What about running ActionCable standalone server? Are you using puma?
Add cable/config.ru
require_relative '../config/environment'
Rails.application.eager_load!
run ActionCable.server
And start your server (on 28080 port):
bundle exec puma -p 28080 cable/config.ru
Upvotes: 1