diff --git a/lib/http-proxy/passes/web-incoming.js b/lib/http-proxy/passes/web-incoming.js index 9732934..9273752 100644 --- a/lib/http-proxy/passes/web-incoming.js +++ b/lib/http-proxy/passes/web-incoming.js @@ -95,7 +95,7 @@ web_o = Object.keys(web_o).map(function(pass) { var forwardReq = (options.forward.protocol === 'https:' ? https : http).request( common.setupOutgoing(options.ssl || {}, options, req, 'forward') ); - req.pipe(forwardReq); + (options.buffer || req).pipe(forwardReq); return res.end(); } @@ -114,7 +114,7 @@ web_o = Object.keys(web_o).map(function(pass) { } }); - req.pipe(proxyReq); + (options.buffer || req).pipe(proxyReq); proxyReq.on('response', function(proxyRes) { for(var i=0; i < web_o.length; i++) { @@ -124,10 +124,6 @@ web_o = Object.keys(web_o).map(function(pass) { proxyRes.pipe(res); }); - if(options.buffer) { - options.buffer.resume(); - } - //proxyReq.end(); }