Ruby on Rails: How can I access Action Cable through ngrok?

Viewed 218

I started the puma server as normal as port 3000. In my development file, I have:

config.action_cable.url = "wss://xxxxxx.ngrok.io/cable"
config.action_cable.allowed_request_origins = [/http:\/\/*/, /https:\/\/*/]

However when I start the app, I get this issue in Chrome console:

WebSocket connection to 'wss://xxxxxx.ngrok.io/cable' failed: 

I disabled my firewall settings too and still get the same issue. Is there a correct way to access Action Cable web sockets through ngrok?

1 Answers

One solution that worked for me is to add this to config/development.rb:

config.action_cable.disable_request_forgery_protection = true
Related