title: actioncable can't connect to websocket
body: <p>I can't connect to the actioncable websocket.</p>
  
  <p>I added this line to my routes.rb</p>
  
  <pre><code>match "/websocket", :to =&gt; ActionCable.server, via: [:get, :post]
  </code></pre>
  
  <p>and I added this files to my app path:
  cable/config.ru</p>
  
  <pre><code># cable/config.ru
  require ::File.expand_path('../../config/environment',  __FILE__)
  Rails.application.eager_load!
  
  require 'action_cable/process/logging'
  
  run ActionCable.server
  </code></pre>
  
  <p>channels/application_cable/channel.rb</p>
  
  <pre><code>module ApplicationCable
    class Channel &lt; ActionCable::Channel::Base
    end
  end
  </code></pre>
  
  <p>channels/application_cable/connection.rb</p>
  
  <pre><code>module ApplicationCable
    class Connection &lt; ActionCable::Connection::Base
      identified_by :current_user
  
      def connect
        self.current_user = find_verified_user
      end
  
      protected
        def find_verified_user
          if current_user
            current_user
          else
            reject_unauthorized_connection
          end
        end
    end
  end
  </code></pre>
  
  <p>and my javascriptfiles under
  assets/javascript/channels/index.coffee</p>
  
  <pre><code>#= require cable
  #= require_self
  #= require_tree .
  
  @App = {}
  # App.cable = Cable.createConsumer 'ws://localhost:28080'
  # App.cable = Cable.createConsumer 'ws://localhost/websocket'
  </code></pre>
  
  <p>then I started my rails app with:</p>
  
  <pre><code>TRUSTED_IP=192.168.0.0/16 rails s -b 192.168.56.101 Puma
  </code></pre>
  
  <p>and my ActionCalbe-Server with:</p>
  
  <pre><code>bundle exec puma -p 28080 cable/config.ru
  </code></pre>
  
  <p>When I opened my Application in the browser I get this errors:</p>
  
  <pre><code>Firefox kann keine Verbindung zu dem Server unter ws://localhost:28080/ aufbauen.
  Firefox kann keine Verbindung zu dem Server unter ws://localhost/websocket aufbauen.
  </code></pre>
  
  <p>How I can solve my problem? I didn't find the mistake :/ </p>