Socket
Socket
Sign inDemoInstall

agentkeepalive

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

agentkeepalive - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

5

History.md
1.1.0 / 2014-08-28
==================
* add some socket counter for deep monitor
1.0.0 / 2014-08-13

@@ -3,0 +8,0 @@ ==================

3

lib/_http_agent.js

@@ -108,4 +108,4 @@ // Copyright Joyent, Inc. and other Node contributors.

socket._onKeepAliveTimeout = function () {
// debug('free socket timeout', name);
this.destroy();
self.emit('timeout');
};

@@ -236,2 +236,3 @@ }

self.removeSocket(s, options);
self.emit('close');
}

@@ -238,0 +239,0 @@ s.on('close', onClose);

@@ -23,6 +23,7 @@ /**!

var debug = util.debuglog('http');
var OriginalAgent = require('./_http_agent').Agent;
var OriginalHttpsAgent = https.Agent;
module.exports = Agent;
function Agent(options) {

@@ -32,3 +33,3 @@ if (!(this instanceof Agent)) {

}
options = options || {};

@@ -39,6 +40,20 @@ // default is keep-alive and 15s free socket timeout

OriginalAgent.call(this, options);
var self = this;
self.createSocketCount = 0;
self.closeSocketCount = 0;
self.requestCount = 0;
self.timeoutSocketCount = 0;
self.on('free', function () {
self.requestCount++;
});
self.on('timeout', function () {
self.timeoutSocketCount++;
});
self.on('close', function () {
self.closeSocketCount++;
});
}
util.inherits(Agent, OriginalAgent);
module.exports = Agent;

@@ -51,2 +66,3 @@ Agent.prototype.createSocket = function (req, options) {

}
this.createSocketCount++;
return socket;

@@ -53,0 +69,0 @@ };

{
"name": "agentkeepalive",
"version": "1.0.0",
"version": "1.1.0",
"description": "Missing keepalive http.Agent",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc