Connecting ActionCable to different host
<p>I'm running a rails 5 app as a backend server, and an ember application for a front-end application.  They are two separate applications hosted on two different domains - say, <code>backend.dev</code> and <code>frontend.dev</code></p>

<p>The rails application has a simple connection class found at <code>app/channels/application_cable/connection.rb</code> that looks like the following:</p>

<pre><code>module ApplicationCable
  class Connection &lt; ActionCable::Connection::Base
    def connect
      Rails.logger.debug("env: #{env.inspect}")
      Rails.logger.info("cookies.signed: #{cookies.signed.inspect}")
    end
  end
end
</code></pre>

<p>I have a simple base channel class at <code>app/channels/application_cable/channel.rb</code> with the following:</p>

<pre><code>module ApplicationCable
  class Channel &lt; ActionCable::Channel::Base
  end
end
</code></pre>

<p>And a single implementation of that class at <code>app/channels/events_channel.rb</code>:</p>

<pre><code>class EventsChannel &lt; ApplicationCable::Channel
  def subscribed
    Rails.logger.debug("env: #{env.inspect}")
    Rails.logger.info("cookies.signed: #{cookies.signed.inspect}")
    stream_from 'events'
  end
end
</code></pre>

<p>On the ember side of things, I'm using the ember-cable package.  I've setup my consumer in my frontend by extending the controller class with the following:</p>

<pre><code>cableService: Ember.inject.service('cable'),

setupConsumer: Ember.on('init', function() {
  let service = this.get('cableService');
  let consumer = service.createConsumer(`ws://backend.dev`);
  let channel = 'EventsChannel';

  consumer.subscriptions.create(channel, {
    disconnected() {
      Ember.debug(`${channel}#disconnected`);
    },

    connected() {
      Ember.debug(`${channel}#connected`);
    },
</code></pre>

<p>I'm fairly sure that my consumer is setup correctly, as I'm seeing <em>some</em> debug output when I get the following output to my js console:</p>

<pre><code>DEBUG: EventsChannel#disconnected
</code></pre>

<p>However, I'm also seeing an odd error in the console as well:</p>

<pre><code>WebSocket connection to 'ws://backend.dev/' failed: Error during WebSocket handshake: Unexpected response code: 200
</code></pre>

<p>I'm not sure what to make of the response code error here, and there's absolutely nothing being logged in my rails app.  Is there anything additional that I need to setup to have actioncable work across domains?  Any idea of what the 200 response code means here?</p>