Comparing version 0.4.6 to 0.4.7
@@ -22,2 +22,3 @@ var Stream = require('stream') | ||
// keepAlive: use an alternate Agent that does keep-alive properly (boolean) default false | ||
// agentOptions: {} an object for passing options directly to the Http Agent | ||
// } | ||
@@ -43,10 +44,10 @@ function Endpoint(protocol, ip, port, options) { | ||
if (protocol === http) { | ||
this.agent = new KeepAlive() | ||
this.agent = new KeepAlive(options.agentOptions) | ||
} | ||
else { | ||
this.agent = new KeepAlive.Secure() | ||
this.agent = new KeepAlive.Secure(options.agentOptions) | ||
} | ||
} | ||
else { | ||
this.agent = new protocol.Agent() | ||
this.agent = new protocol.Agent(options.agentOptions) | ||
} | ||
@@ -53,0 +54,0 @@ this.agent.maxSockets = options.maxSockets || 20 |
@@ -19,2 +19,3 @@ module.exports = function (inherits, EventEmitter, Endpoint, RequestSet) { | ||
// maxRetries: number (default = 5) | ||
// agentOptions: {} an object for passing options directly to the Http Agent | ||
// } | ||
@@ -21,0 +22,0 @@ function Pool(http, nodes, options) { |
{ | ||
"name": "poolee", | ||
"version": "0.4.6", | ||
"version": "0.4.7", | ||
"description": "HTTP pool and load balancer", | ||
@@ -5,0 +5,0 @@ "homepage": "http://github.com/dannycoates/poolee", |
@@ -73,2 +73,3 @@ # poolee | ||
, name: undefined // optional string | ||
, agentOptions: undefined// an object for passing options directly to the Http Agent | ||
} | ||
@@ -127,2 +128,7 @@ ) | ||
###### agentOptions | ||
These options are passed directly to the underlying Agents used in the pool. This | ||
is nice for passing options like `cert` and `key` that are required for client certificates. | ||
###### ping | ||
@@ -129,0 +135,0 @@ |
@@ -5,2 +5,3 @@ var assert = require("assert") | ||
var http = require('http') | ||
var https = require('https') | ||
var Stream = require('stream') | ||
@@ -15,2 +16,25 @@ | ||
it("passes nothing to the Agent constructor when no agentOptions are given", function () { | ||
var e = new Endpoint(http, '127.0.0.1', 6969, { bogus: true }) | ||
assert.equal(e.agent.options.bogus, undefined) | ||
}) | ||
it("passes agentOptions to the underlying Agent (no keep-alive)", function () { | ||
var e = new Endpoint(http, '127.0.0.1', 6969, { agentOptions: { cert: 'foo', key: 'bar'}}) | ||
assert.equal(e.agent.options.cert, 'foo') | ||
assert.equal(e.agent.options.key, 'bar') | ||
}) | ||
it("passes agentOptions to the underlying Agent (keep-alive)", function () { | ||
var e = new Endpoint(http, '127.0.0.1', 6969, {keepAlive: true, agentOptions: { cert: 'foo', key: 'bar'}}) | ||
assert.equal(e.agent.options.cert, 'foo') | ||
assert.equal(e.agent.options.key, 'bar') | ||
}) | ||
it("passes agentOptions to the underlying Agent (keep-alive secure)", function () { | ||
var e = new Endpoint(https, '127.0.0.1', 6969, {keepAlive: true, agentOptions: { cert: 'foo', key: 'bar'}}) | ||
assert.equal(e.agent.options.cert, 'foo') | ||
assert.equal(e.agent.options.key, 'bar') | ||
}) | ||
// | ||
@@ -17,0 +41,0 @@ // unhealthy |
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
Non-existent author
Supply chain riskThe package was published by an npm account that no longer exists.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
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
52995
1489
239
1
4