Skip to content
Permalink
Browse files

[fix] support buffer

  • Loading branch information...
yawnt committed Oct 29, 2013
1 parent f720e36 commit 1204a35e467c6c1855ba0dac8f55d79f899148a6
Showing with 2 additions and 6 deletions.
  1. +2 −6 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();
}

0 comments on commit 1204a35

Please sign in to comment.
You can’t perform that action at this time.