mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
[fix] closes #553
This commit is contained in:
parent
3330e125aa
commit
53a2653b5e
@ -26,9 +26,15 @@ httpProxy.Server = ProxyServer;
|
||||
*/
|
||||
|
||||
function createRightProxy(type) {
|
||||
var webPasses = Object.keys(web).map(function(pass) {
|
||||
return web[pass];
|
||||
});
|
||||
var wsPasses = Object.keys(ws).map(function(pass) {
|
||||
return ws[pass];
|
||||
});
|
||||
return function(options) {
|
||||
return function(req, res /*, [head], [opts] */) {
|
||||
var passes = (type === 'ws') ? this.wsPasses : this.webPasses,
|
||||
var passes = (type === 'ws') ? (this.wsPasses || wsPasses) : (this.webPasses || webPasses),
|
||||
args = [].slice.call(arguments),
|
||||
cntr = args.length - 1,
|
||||
head, cbl;
|
||||
@ -63,6 +69,7 @@ function createRightProxy(type) {
|
||||
options[e] = parse_url(options[e]);
|
||||
});
|
||||
|
||||
if(typeof this.emit == 'undefined' && !cbl) { throw new Error("You need to pass a callback to handle errors") }
|
||||
|
||||
for(var i=0; i < passes.length; i++) {
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user