From 15afc23a275f3fa16653fff6179368122661a0af Mon Sep 17 00:00:00 2001 From: Anders Johnson Date: Sat, 12 Jan 2013 21:55:46 -0600 Subject: [PATCH] fix 'this' reference in routing proxy listener bindings --- lib/node-http-proxy/routing-proxy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node-http-proxy/routing-proxy.js b/lib/node-http-proxy/routing-proxy.js index e8bc0cf..d00b722 100644 --- a/lib/node-http-proxy/routing-proxy.js +++ b/lib/node-http-proxy/routing-proxy.js @@ -60,7 +60,7 @@ var RoutingProxy = exports.RoutingProxy = function (options) { this.on('newListener', function (evt) { if (evt === 'proxyError' || evt === 'webSocketProxyError') { Object.keys(self.proxies).forEach(function (key) { - self.proxies[key].on(evt, this.emit.bind(this, evt)); + self.proxies[key].on(evt, self.emit.bind(self, evt)); }); } });