How to use the agentkeepalive.prototype function in agentkeepalive

To help you get started, we’ve selected a few agentkeepalive examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wuchangming / node-mitmproxy / src / common / ProxyHttpAgent.js View on Github external
getName (option) {
        var name = AgentOrigin.prototype.getName.call(this, option);
        name += ':';
        if (option.customSocketId) {
            name += option.customSocketId
        }
        return name;
    }
}
github braintree / mallorca / lib / upstream.js View on Github external
var https = require('https');
var http = require('http');
var Watchdog = require('./watchdog');
var HttpAgent = require('agentkeepalive');
var HttpsAgent = HttpAgent.HttpsAgent;
HttpsAgent.prototype.getName = HttpAgent.prototype.getName;

function Upstream(upstreamURL, statsdClient, agentOpts) {
  if (typeof upstreamURL === 'string') {
    upstreamURL = require('url').parse(upstreamURL);
  }
  this.host = upstreamURL.hostname;
  this.protocol = upstreamURL.protocol;
  this.port = parseInt(upstreamURL.port, 10) || (this.protocol == 'https:' ? 443 : 80);
  this.httpModule = this.protocol == 'http:' ? http : https;
  this.agent = agentOpts ? createAgent(this.protocol, agentOpts) : false;
  this.forwardAgent = agentOpts ? agentOpts.forwardAgent : false;
  this.dog = new Watchdog(this.port, this.host);
  this.statsdClient = statsdClient;
  if (!this.statsdClient.fake) {
    this.statsdTimer = setInterval(this.recordPoolStats.bind(this), 1000);
  }

agentkeepalive

Missing keepalive http.Agent

MIT
Latest version published 10 months ago

Package Health Score

83 / 100
Full package analysis