From abf1d90fdf05a17ebe05a3e90d464a592e0aee69 Mon Sep 17 00:00:00 2001 From: yawnt Date: Wed, 28 Aug 2013 15:22:04 +0200 Subject: [PATCH] [fix] use agent pool --- lib/caronte.js | 2 +- lib/caronte/common.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/caronte.js b/lib/caronte.js index 81a25e4..3ccd251 100644 --- a/lib/caronte.js +++ b/lib/caronte.js @@ -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 { diff --git a/lib/caronte/common.js b/lib/caronte/common.js index 78b4586..68f4a92 100644 --- a/lib/caronte/common.js +++ b/lib/caronte/common.js @@ -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]; } );