mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
[fix] use agent pool
This commit is contained in:
parent
c9612798f1
commit
abf1d90fdf
@ -45,7 +45,7 @@ proxy.createProxyServer = function createProxyServer(options) {
|
||||
options[key] = url.parse(options[key]);
|
||||
|
||||
options[key].maxSockets = options.maxSock;
|
||||
options[key].agent = new (options.ssl ? https.Agent : http.Agent)(options[key]);
|
||||
options[key].agent = new (options.ssl ? https.Agent : http.Agent)(options[key].maxSockets || 100);
|
||||
});
|
||||
|
||||
return {
|
||||
|
||||
@ -21,7 +21,7 @@ var common = exports;
|
||||
*/
|
||||
|
||||
common.setupOutgoing = function(outgoing, options, req, forward) {
|
||||
['host', 'hostname', 'port', 'socketPath'/*, 'agent'*/].forEach(
|
||||
['host', 'hostname', 'port', 'socketPath', 'agent'].forEach(
|
||||
function(e) { outgoing[e] = options[forward || 'target'][e]; }
|
||||
);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user