mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
[fix] support buffer
This commit is contained in:
parent
f720e36b42
commit
1204a35e46
@ -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();
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user