title: Rails Action Cable Request origin not allowed
body: <p>I am trying to configure Action Cable in my api-only rails application. After a very basic set up I tried to connect to the server from my Ember application. It doesn't connect and on Rails console I see following error entries:</p>
  
  <pre><code>Started GET "/cable" for 172.17.0.1 at 2017-12-20 10:17:26 +0000
  Started GET "/cable/" [WebSocket] for 172.17.0.1 at 2017-12-20 10:17:26 Request origin not allowed: http://localhost:4200
  Failed to upgrade to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: Upgrade, HTTP_UPGRADE: websocket)
  Finished "/cable/" [WebSocket] for 172.17.0.1 at 2
  </code></pre>
  
  <p>After a quick search (followed by a compreshensive one) the solution looked simple. Add following line in config/development.rb and it should be resolved:</p>
  
  <pre><code>config.action_cable.allowed_request_origins = ['http://localhost:4200']
  </code></pre>
  
  <p>(note: 4200 is the port where ember server is running and the request is coming from, the rails is running on standad 3000 port). However, the problem is still there. I tried lot of things whtatever I could find on internet but the problem is still there. </p>
  
  <p>Thanks</p>