Socket
Socket
Sign inDemoInstall

forever-agent

Package Overview
Dependencies
0
Maintainers
3
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.6.0 to 0.6.1

17

index.js

@@ -9,2 +9,13 @@ module.exports = ForeverAgent

, AgentSSL = require('https').Agent
function getConnectionName(host, port) {
var name = ''
if (typeof host === 'string') {
name = host + ':' + port
} else {
// For node.js v012.0 and iojs-v1.5.1, host is an object. And any existing localAddress is part of the connection name.
name = host.host + ':' + host.port + ':' + (host.localAddress ? (host.localAddress + ':') : ':')
}
return name
}

@@ -20,3 +31,4 @@ function ForeverAgent(options) {

self.on('free', function(socket, host, port) {
var name = host + ':' + port
var name = getConnectionName(host, port)
if (self.requests[name] && self.requests[name].length) {

@@ -52,2 +64,4 @@ self.requests[name].shift().onSocket(socket)

ForeverAgent.prototype.addRequest = function(req, host, port) {
var name = getConnectionName(host, port)
if (typeof host !== 'string') {

@@ -59,3 +73,2 @@ var options = host

var name = host + ':' + port
if (this.freeSockets[name] && this.freeSockets[name].length > 0 && !req.useChunkedEncodingByDefault) {

@@ -62,0 +75,0 @@ var idleSocket = this.freeSockets[name].pop()

2

package.json

@@ -5,3 +5,3 @@ {

"description": "HTTP Agent that keeps socket connections alive between keep-alive requests. Formerly part of mikeal/request, now a standalone module.",
"version": "0.6.0",
"version": "0.6.1",
"license": "Apache-2.0",

@@ -8,0 +8,0 @@ "repository": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc