Ruby on rails RubyonRails:如何通过ngrok访问ActionCable?

Ruby on rails RubyonRails:如何通过ngrok访问ActionCable?,ruby-on-rails,ruby,websocket,actioncable,ngrok,Ruby On Rails,Ruby,Websocket,Actioncable,Ngrok,我启动了puma服务器,端口3000正常。在我的开发文件中,我有: config.action_cable.url = "wss://xxxxxx.ngrok.io/cable" config.action_cable.allowed_request_origins = [/http:\/\/*/, /https:\/\/*/] 然而,当我启动应用程序时,我在Chrome控制台中遇到了这个问题: WebSocket connection to 'wss://xxxxxx.n

我启动了puma服务器,端口3000正常。在我的开发文件中,我有:

config.action_cable.url = "wss://xxxxxx.ngrok.io/cable"
config.action_cable.allowed_request_origins = [/http:\/\/*/, /https:\/\/*/]
然而,当我启动应用程序时,我在Chrome控制台中遇到了这个问题:

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

我也禁用了防火墙设置,但仍然遇到同样的问题。有没有通过ngrok访问Action Cable web套接字的正确方法?

一个对我有效的解决方案是将其添加到config/development.rb:

config.action_cable.disable_request_forgery_protection = true