title: Django channels socket not connecting to consumer
body: <p>I'm new to socket programming &amp; I'm kindof stuck with an issue here. My client is not connecting to consumer.</p>
  <p><strong>JavaScript Code</strong></p>
  <pre><code>&lt;script&gt;
      // websocket scripts
      var socket = new WebSocket(&quot;ws://127.0.0.1:8000/test/&quot;)
  &lt;/script&gt;
  </code></pre>
  <p><strong>Routing</strong></p>
  <pre><code>application = ProtocolTypeRouter({
      # (http-&gt;django views is added by default)
      'websocket': AuthMiddlewareStack(
          URLRouter(
              [
                  url(r'^ws/test', consumers.TestConsumer),
              ]
          )
      ),
  })
  </code></pre>
  <p><strong>The error</strong></p>
  <pre><code>WebSocket connection to 'ws://127.0.0.1:8000/test/' failed: Error during WebSocket handshake: net::ERR_CONNECTION_RESET
  </code></pre>