[fix] pooled connections, closes #478

This commit is contained in:
yawnt 2013-09-17 12:14:52 +02:00
parent 6b61878759
commit afc4d0931f

View File

@ -32,6 +32,7 @@ proxy.createProxyServer = function createProxyServer(options) {
" ws : <true/false, if you want to proxy websockets> ",
" xfwd : <true/false, adds x-forward headers> ",
" maxSock: <maximum number of sockets> ",
" agent : <http agent for pooled connections> ",
" } ",
" ",
"NOTE: `options.ws` and `options.ssl` are optional. ",
@ -45,7 +46,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].maxSockets || 100);
options[key].agent = options.agent || false // new (options.ssl ? https.Agent : http.Agent)(options[key].maxSockets || 100);
});
options.ee = new events.EventEmitter2({ wildcard: true, delimiter: ':' });