Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

agentkeepalive

Package Overview
Dependencies
Maintainers
4
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

agentkeepalive

Missing keepalive http.Agent

  • 4.3.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11M
decreased by-5.99%
Maintainers
4
Weekly downloads
 
Created

What is agentkeepalive?

The agentkeepalive npm package is a module that provides an HTTP(S) Agent which keeps socket connections alive between keep-alive requests. It is designed to improve the performance of HTTP clients by reusing sockets for subsequent requests to the same servers, which can reduce the overhead of establishing new TCP connections.

What are agentkeepalive's main functionalities?

HTTP Keep-Alive Agent

This feature allows you to create an HTTP agent that reuses sockets for HTTP requests to improve performance.

const { HttpAgent } = require('agentkeepalive');
const keepaliveAgent = new HttpAgent();
const http = require('http');

http.request({
  host: 'localhost',
  port: 80,
  path: '/',
  agent: keepaliveAgent
});

HTTPS Keep-Alive Agent

This feature allows you to create an HTTPS agent that reuses sockets for HTTPS requests to improve performance.

const { HttpsAgent } = require('agentkeepalive').HttpsAgent;
const keepaliveAgent = new HttpsAgent();
const https = require('https');

https.request({
  host: 'localhost',
  port: 443,
  path: '/',
  agent: keepaliveAgent
});

Custom Agent Options

This feature allows you to customize the behavior of the keep-alive agent by setting options such as the maximum number of sockets, the maximum number of free sockets, socket timeout, and free socket timeout.

const { HttpAgent } = require('agentkeepalive');
const keepaliveAgent = new HttpAgent({
  maxSockets: 50,
  maxFreeSockets: 10,
  timeout: 60000,
  freeSocketTimeout: 30000
});

Other packages similar to agentkeepalive

Keywords

FAQs

Package last updated on 06 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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