mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
added what is necessary for having proxyError on Routing proxywq
This commit is contained in:
parent
ccccc45f11
commit
b7adf866b5
@ -90,6 +90,8 @@ RoutingProxy.prototype.add = function (options) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.proxies[key] = new HttpProxy(options);
|
this.proxies[key] = new HttpProxy(options);
|
||||||
|
this.proxies[key].on('proxyError', this.emit.bind(this, 'proxyError'));
|
||||||
|
this.proxies[key].on('webSocketProxyError', this.emit.bind(this, 'webSocketProxyError'));
|
||||||
};
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -183,6 +185,7 @@ RoutingProxy.prototype.proxyRequest = function (req, res, options) {
|
|||||||
|
|
||||||
if (!this.proxies[key]) {
|
if (!this.proxies[key]) {
|
||||||
this.add(options);
|
this.add(options);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
proxy = this.proxies[key];
|
proxy = this.proxies[key];
|
||||||
@ -220,7 +223,7 @@ RoutingProxy.prototype.proxyWebSocketRequest = function (req, socket, head, opti
|
|||||||
|
|
||||||
if (!this.proxies[key]) {
|
if (!this.proxies[key]) {
|
||||||
this.add(options);
|
this.add(options);
|
||||||
}
|
}
|
||||||
|
|
||||||
proxy = this.proxies[key];
|
proxy = this.proxies[key];
|
||||||
proxy.proxyWebSocketRequest(req, socket, head, options.buffer);
|
proxy.proxyWebSocketRequest(req, socket, head, options.buffer);
|
||||||
@ -244,4 +247,4 @@ RoutingProxy.prototype._getKey = function (options) {
|
|||||||
options.host || options.target.host,
|
options.host || options.target.host,
|
||||||
options.port || options.target.port
|
options.port || options.target.port
|
||||||
].join(':');
|
].join(':');
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user