【发布时间】:2021-03-09 17:48:14
【问题描述】:
我对 ActionCable 完全陌生...尝试在 Rails 6.0 应用程序(Nginx + Puma)上设置 Action cable。我还不得不说我的环境是在云端 (DigitalOcean.com),那就是 SSL。
我的配置/cable.yml:
development:
adapter: redis
url: redis://localhost:6379
我的 config/environments/development.rb :我刚刚添加了这些行
config.action_cable.allowed_request_origins = ["https://my.url.com/"]
config.action_cable.url = "ws://localhost:3000/cable"
当然:my.url.com 是我的域名。
我收到此错误:
WebSocket connection to 'wss://my.url.com/cable' failed: WebSocket is closed before the connection is established.
有人有想法吗?
非常感谢:-)
【问题讨论】:
-
曾经得到这个答案吗?我在同一条船上
标签: ruby-on-rails nginx redis puma actioncable