mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
fix 'this' reference in routing proxy listener bindings
This commit is contained in:
parent
26d3646ff2
commit
15afc23a27
@ -60,7 +60,7 @@ var RoutingProxy = exports.RoutingProxy = function (options) {
|
|||||||
this.on('newListener', function (evt) {
|
this.on('newListener', function (evt) {
|
||||||
if (evt === 'proxyError' || evt === 'webSocketProxyError') {
|
if (evt === 'proxyError' || evt === 'webSocketProxyError') {
|
||||||
Object.keys(self.proxies).forEach(function (key) {
|
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));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user