title: Socket.io - failed: Connection closed before receiving a handshake response
body: <p><strong>Socket.io for NodeJS doesn't seem to work as a websocket server</strong></p>
  
  <p>For some reason, socket.io ALWAYS fallback to the long polling and if I force the websocket transport layer, it will error out:</p>
  
  <blockquote>
    <p>failed: Connection closed before receiving a handshake response</p>
  </blockquote>
  
  <p>The right ports are open. I'm using the <a href="https://github.com/guille/chat-example">chat example</a> from socket.io.
  I set up the server on <a href="http://jmi.io:3000">http://jmi.io:3000</a>. As you can see, it works fine with a beautiful long polling channel but now try the websocket connection from a websocket client and...</p>
  
  <blockquote>
    <p>WebSocket connection to 'ws://jmi:3000/' failed: Connection closed before receiving a handshake response </p>
  </blockquote>
  
  <p>I have only one node single threaded and have the exact same package.json than in the chat example repo.</p>
  
  <pre><code>{
    "name": "socket-chat-example",
    "version": "0.0.1",
    "description": "my first socket.io app",
    "dependencies": {
      "express": "4.3.1",
      "socket.io": "1.2.0"
    }
  }
  </code></pre>
  
  <p>Thank you for your help</p>