mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
[refactor] Pass all options to Agent constructor
This commit is contained in:
parent
e925e4928f
commit
eafdc744b6
@ -352,12 +352,7 @@ exports._getAgent = function _getAgent (options) {
|
|||||||
var Agent = options.https ? https.Agent : http.Agent,
|
var Agent = options.https ? https.Agent : http.Agent,
|
||||||
agent;
|
agent;
|
||||||
|
|
||||||
agent = new Agent({
|
agent = new Agent(options);
|
||||||
host: options.host,
|
|
||||||
port: options.port
|
|
||||||
});
|
|
||||||
|
|
||||||
agent.maxSockets = options.maxSockets || maxSockets;
|
|
||||||
|
|
||||||
return agent;
|
return agent;
|
||||||
}
|
}
|
||||||
@ -392,4 +387,4 @@ exports._getBase = function _getBase (options) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user