Skip to content

Commit

Permalink
[fix] support buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
yawnt committed Oct 29, 2013
1 parent f720e36 commit 1204a35
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/http-proxy/passes/web-incoming.js
Expand Up @@ -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();
}

Expand All @@ -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++) {
Expand All @@ -124,10 +124,6 @@ web_o = Object.keys(web_o).map(function(pass) {
proxyRes.pipe(res);
});

if(options.buffer) {
options.buffer.resume();
}

//proxyReq.end();
}

Expand Down

0 comments on commit 1204a35

Please sign in to comment.