I opened https://www.reactrails.com/ in two browsers.
When I posted a comment, it didn’t updated automatically on the other browser…
I meant a realtime update.
Locally, it was working same way (non-realtime update) with the log output:
13:02:55 rails.1 | Started GET "/cable" for 127.0.0.1 at 2017-02-15 13:02:55 +0900
13:02:55 rails.1 | Started GET "/cable/" [WebSocket] for 127.0.0.1 at 2017-02-15 13:02:55 +0900
13:02:55 rails.1 | Request origin not allowed: http://localhost:5000
13:02:55 rails.1 | Failed to upgrade to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: Upgrade, HTTP_UPGRADE: websocket)
13:02:55 rails.1 | Finished "/cable/" [WebSocket] for 127.0.0.1 at 2017-02-15 13:02:55 +0900
But I had it working with 2 things:
Added config.action_cable.allowed_request_origins = ['http://localhost:5000'] in development.rb as rails server was running on port 5000 (Ref: http://stackoverflow.com/a/35442353/1745902)
Then I started redis-server, as it was then giving error Error connecting to Redis on localhost:6379 (Errno::ECONNREFUSED) (Redis::CannotConnectError)
I’m wondering if heroku app is having same error Request origin not allowed ?