mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
[fix] pooled connections, closes #478
This commit is contained in:
parent
6b61878759
commit
afc4d0931f
@ -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: ':' });
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user