Since I have spent about 15 minutes today trying to figure out why my WebSockets are not updating in development, I have decided to put quick fix here, hopefully this will be useful.
Issue:
Let me help you!
Hey, I am Anatoly, founder of this blog. I would love to help you! I have 6+ years experience in Web Development and IT Leadership. Lets work together on your project! Leave me your email and I will schedule a FREE Consultation!
When I started ActionCable I got this error:
Request origin not allowed: http://0.0.0.0:3000 Failed to upgrade to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: Upgrade, HTTP_UPGRADE: websocket) Finished "/cable/" [WebSocket] for 127.0.0.1 at 2016-08-01 14:23:38 -0700
Solution:
- Go to
development.rb
- Add following line:
config.action_cable.allowed_request_origins = ['http://0.0.0.0:3000']
- Restart Web Server
- Enjoy!
Click Subscribe to stay tuned for some cool Rails 5 ActionCable examples!
Cheers,
Anatoly
Thanks for installing the Bottom of every post plugin by Corey Salzano. Contact me if you need custom WordPress plugins or website design.
[…] have create separate post how to resolve it ,but for your convenience, I will repeat it […]
Thank you very much, exactly what I needed.
Great Job. You just saved my time 🙂