title: node-http-proxy socket.io websocket connection
body: <p>I'm trying to get node-http-proxy with socket.io to work, but it always falls back to xhr, websockets won't work, although I'm connecting to the upgrade event as described in the node-http-proxy docs.</p>
  
  <pre><code>var httpProxy = require ("http-proxy");
  
  var server = httpProxy.createServer (function (req, res, proxy) {
      var buffer = httpProxy.buffer (req);
      proxy.proxyRequest (req, res, {
          host : "localhost",
          port : 8001,
          buffer : buffer
      });
  });
  server.listen (80);
  
  server.on('upgrade', function (req, socket, head) {
      server.proxy.proxyWebSocketRequest(req, socket, head, { host : "localhost", port : 8001 });
  });
  </code></pre>
  
  <p>The app obviously runs on localhost:8001 and if I allow all transport methods it will work fine as it uses xhrs. If I force it to use websockets firefox will say</p>
  
  <pre><code>Firefox can't establish a connection to the server at ws://localhost/socket.io/1/websocket/cNp5J80KAWkXqjE6OZOt. @ http://localhost/socket.io/socket.io.js:2371
  </code></pre>
  
  <p>Just using the default method</p>
  
  <pre><code>httpProxy.createServer (8001, "localhost").listen (80);
  </code></pre>
  
  <p>results in the same error.</p>