I am trying to get websockets to work with node-http-proxy . The difference is that I am using proxytable:
var options = { router: { 'a.websterten.com': '127.0.0.1:150', 'b.websterten.com' : '127.0.0.1:151', } }; var server = httpProxy.createServer(options);
I tried:
server.on('upgrade', function (req, socket, head) { server.proxy.proxyWebSocketRequest(req, socket, head); });
But that does not work. Quick check if websockets is working, I get Unexpected response code: 400 from Chrome (works fine if I go directly)
Also doing a few server.on('upgrade',.. checks server.on('upgrade',.. does not start on websocket request
How can I get my proxy to route websites correctly?
I also tried this on node 0.8.23, as well as node 0.10.x (later versions of node have a memory leak problem, but it will not work with 0.8.23)
Akshat
source share