tunnel-agent
Advanced tools
Comparing version 0.3.0 to 0.4.0
15
index.js
@@ -70,5 +70,14 @@ 'use strict' | ||
TunnelingAgent.prototype.addRequest = function addRequest(req, host, port) { | ||
TunnelingAgent.prototype.addRequest = function addRequest(req, options) { | ||
var self = this | ||
// Legacy API: addRequest(req, host, port, path) | ||
if (typeof options === 'string') { | ||
options = { | ||
host: options, | ||
port: arguments[2], | ||
path: arguments[3] | ||
}; | ||
} | ||
if (self.sockets.length >= this.maxSockets) { | ||
@@ -81,3 +90,3 @@ // We are over limit so we'll add it to the queue. | ||
// If we are under maxSockets create a new one. | ||
self.createSocket({host: host, port: port, request: req}, function(socket) { | ||
self.createSocket({host: options.host, port: options.port, request: req}, function(socket) { | ||
socket.on('free', onFree) | ||
@@ -89,3 +98,3 @@ socket.on('close', onCloseOrRemove) | ||
function onFree() { | ||
self.emit('free', socket, host, port) | ||
self.emit('free', socket, options.host, options.port) | ||
} | ||
@@ -92,0 +101,0 @@ |
@@ -5,3 +5,3 @@ { | ||
"description": "HTTP proxy tunneling agent. Formerly part of mikeal/request, now a standalone module.", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"repository": { | ||
@@ -8,0 +8,0 @@ "url": "https://github.com/mikeal/tunnel-agent" |
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
16379
5
203