title: Trouble connecting to Action Cable with remote origin
body: <p>I've setup a websocket on our Rails app, and have been able to connect and receive data on it from the same server.</p>
  
  <p>The way I've done it now is to create a socket like this:</p>
  
  <pre><code>class UsersChannel &lt; ApplicationCable::Channel
    def subscribed
      stream_from "users_1"
    end
  
    def unsubscribed
  
    end
  end
  </code></pre>
  
  <p>and then I use javascript to open the connection with</p>
  
  <p><code>new WebSocket('wss://domain.com/cable/users_1');</code></p>
  
  <p>I then broadcast and send JSON from a page in this format:</p>
  
  <pre><code>ActionCable.server.broadcast "users_1", {
        store: {
          name: store.name,
          address: {
            full_address: location.address,
            latitude: location.latitude,
            longitude: location.longitude
          }
      }
  </code></pre>
  
  <p>When that's triggered I can see in my console that it appears. I've added this channel in JS:</p>
  
  <pre><code>App.cable.subscriptions.create "UsersChannel",
    received: (data) -&gt;
      console.log data
  </code></pre>
  
  <p>Now we're working building an app with React Native and when we add this code to our app:</p>
  
  <pre><code>var ws = new WebSocket('wss://domain.com/cable/users_1');
  
  ws.onmessage = (e) =&gt; {
    console.log(e.data);
  };
  </code></pre>
  
  <p>we see that it pings, but receive nothing when we trigger the broadcast. I've also added this to the config file:</p>
  
  <pre><code>  config.action_cable.url = 'wss://domain.com/cable'
    config.action_cable.disable_request_forgery_protection = true
  </code></pre>
  
  <p>Anybody know why this is happening?</p>