infinity-agent
Advanced tools
Comparing version 0.1.0 to 0.2.0
@@ -8,4 +8,4 @@ 'use strict'; | ||
function agent(options) { | ||
// if defaultMaxSockets is Infinity - then we should use default agent | ||
if (http.Agent.defaultMaxSockets === Infinity) { | ||
// if defaultMaxSockets is not default 5 - then we should use default agent | ||
if (http.Agent.defaultMaxSockets !== 5) { | ||
return undefined; | ||
@@ -12,0 +12,0 @@ } |
{ | ||
"name": "infinity-agent", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "Creates HTTP/HTTPS Agent with Infinity maxSockets", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# infinity-agent [![Build Status](https://travis-ci.org/floatdrop/infinity-agent.svg?branch=master)](https://travis-ci.org/floatdrop/infinity-agent) | ||
Returns HTTP/HTTPS agent based on URL or options. | ||
Returns HTTP/HTTPS agent with maxSockets set to Infinity (based on URL or options). | ||
__Motivation__: Node 0.10.x is using 5 sockets limit on one host:port pair, but in 0.11.x this is fixed with defaultMaxSockets set to Infinity. To backport this behaviour you can use this module. | ||
## Usage | ||
@@ -24,3 +26,3 @@ | ||
* `undefined`, if http.Agent.defaultMaxSockets is `Infinity` | ||
* `undefined`, if http.Agent.defaultMaxSockets is not `5` | ||
* `agent.httpAgent`, if `options.protocol === 'http:'` (`agent.httpsAgent` otherwise) | ||
@@ -27,0 +29,0 @@ * New instance of HTTPS agent with `options`, if they contains any of [tls options](http://nodejs.org/api/tls.html#tls_tls_connect_options_callback) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4487
37