Skip to content

Commit abf1d90

Browse files
committed
[fix] use agent pool
1 parent c961279 commit abf1d90

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Diff for: lib/caronte.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ proxy.createProxyServer = function createProxyServer(options) {
4545
options[key] = url.parse(options[key]);
4646

4747
options[key].maxSockets = options.maxSock;
48-
options[key].agent = new (options.ssl ? https.Agent : http.Agent)(options[key]);
48+
options[key].agent = new (options.ssl ? https.Agent : http.Agent)(options[key].maxSockets || 100);
4949
});
5050

5151
return {

Diff for: lib/caronte/common.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ var common = exports;
2121
*/
2222

2323
common.setupOutgoing = function(outgoing, options, req, forward) {
24-
['host', 'hostname', 'port', 'socketPath'/*, 'agent'*/].forEach(
24+
['host', 'hostname', 'port', 'socketPath', 'agent'].forEach(
2525
function(e) { outgoing[e] = options[forward || 'target'][e]; }
2626
);
2727

0 commit comments

Comments
 (0)