Skip to content

Commit afc4d09

Browse files
committed
[fix] pooled connections, closes #478
1 parent 6b61878 commit afc4d09

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/caronte.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ proxy.createProxyServer = function createProxyServer(options) {
3232
" ws : <true/false, if you want to proxy websockets> ",
3333
" xfwd : <true/false, adds x-forward headers> ",
3434
" maxSock: <maximum number of sockets> ",
35+
" agent : <http agent for pooled connections> ",
3536
" } ",
3637
" ",
3738
"NOTE: `options.ws` and `options.ssl` are optional. ",
@@ -45,7 +46,7 @@ proxy.createProxyServer = function createProxyServer(options) {
4546
options[key] = url.parse(options[key]);
4647

4748
options[key].maxSockets = options.maxSock;
48-
options[key].agent = new (options.ssl ? https.Agent : http.Agent)(options[key].maxSockets || 100);
49+
options[key].agent = options.agent || false // new (options.ssl ? https.Agent : http.Agent)(options[key].maxSockets || 100);
4950
});
5051

5152
options.ee = new events.EventEmitter2({ wildcard: true, delimiter: ':' });

0 commit comments

Comments
 (0)