mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
[fix] use the correct arguments order
This commit is contained in:
parent
7c72f3b407
commit
cc09ae6a34
@ -73,7 +73,7 @@ function createRightProxy(type) {
|
|||||||
* refer to the connection socket
|
* refer to the connection socket
|
||||||
* pass(req, socket, options, head)
|
* pass(req, socket, options, head)
|
||||||
*/
|
*/
|
||||||
if(passes[i](req, res, cbl ? false : this, head, cbl)) { // passes can return a truthy value to halt the loop
|
if(passes[i](req, res, this.options, head, cbl ? false : this, cbl)) { // passes can return a truthy value to halt the loop
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -89,19 +89,19 @@ web_o = Object.keys(web_o).map(function(pass) {
|
|||||||
* @api private
|
* @api private
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function stream(req, res, server, _, clb) {
|
function stream(req, res, options, head, server, clb) {
|
||||||
if(server.options.forward) {
|
if(options.forward) {
|
||||||
// If forward enable, so just pipe the request
|
// If forward enable, so just pipe the request
|
||||||
var forwardReq = (server.options.forward.protocol === 'https:' ? https : http).request(
|
var forwardReq = (options.forward.protocol === 'https:' ? https : http).request(
|
||||||
common.setupOutgoing(server.options.ssl || {}, server.options, req, 'forward')
|
common.setupOutgoing(options.ssl || {}, options, req, 'forward')
|
||||||
);
|
);
|
||||||
req.pipe(forwardReq);
|
req.pipe(forwardReq);
|
||||||
return res.end();
|
return res.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request initalization
|
// Request initalization
|
||||||
var proxyReq = (server.options.target.protocol === 'https:' ? https : http).request(
|
var proxyReq = (options.target.protocol === 'https:' ? https : http).request(
|
||||||
common.setupOutgoing(server.options.ssl || {}, server.options, req)
|
common.setupOutgoing(options.ssl || {}, options, req)
|
||||||
);
|
);
|
||||||
|
|
||||||
// Error Handler
|
// Error Handler
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user