Created by: bnoguchi
The following would not work, assuming a websocket request is sent, and local.host and sub.local.host can receive socket.io websocket requests:
httpProxy.createServer({
hostnameOnly: true
, router: {
'local.host': 'localhost:3001'
, 'sub.local.host': 'localhost:3002'
}
}).listen(3000);
Even though there is a passing test for websocket proxying when using a routing table in your vows tests, that test does not provide complete coverage, since the test helper it uses passes a callback to httpProxy.createServer(...). When a callback is passed to createServer, then proxyWebSocketRequest is never called because the 'upgrade' event callback is only set up if a callback is passed into createServer. As a result, it does not end up catching this particular issue.