Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
async-keepalive
Advanced tools
electrode-keepalive
provides an HttpAgent capable of maintaining available sockets using IP address instead of hostname lookup. This allows for graceful handling of dns changes/failover when changes occur in routing configuration. This is particularly important when using keep-alive enabled connections. It resolves part of the problems in this issue
const ElectrodeKeepAlive = require("electrode-keepalive");
const opts = {
keepAlive: true,
keepAliveMsecs: 30000, // socket send keep alive ping every 30 secs
maxSockets: 100,
maxFreeSockets: 10
};
const keepAlive = new ElectrodeKeepAlive(opts);
const dnsOptions = {};
keepAlive.preLookup("www.google.com", dnsOptions, (err) => {
request({url: "http://www.google.com", agent: keepAlive.agent});
});
Since this module works by overriding
http.Agent
's synchronousgetName
method to return the IP instead of hostname, it has to use a pre-populated DNS mapping. Before the mapping is populated, it can't use IP. To avoid that in your first request, you should always call thepreLookup
method first.
instance.agent
- Read only instance property to access the http/https agent.
instance.https
- Read only instance property. If true, then the agent is an https agent.
ElectrodeKeepAlive.DNS_CACHE
- Internal DNS mapping object.
constructor(options)
Creates an instance of ElectrodeKeepAlive
.
options
should be the default http agent settings that are passed through to the underlying implementation. Additionally the following options are supported:
https
- If true, then creates an https Agent.expiry
- The duration (in milliseconds) that ip entries in the DNS mapping will be refreshed. Default is 5000ms.instance.preLookup(host, options, callback)
Allows ElectrodeKeepAlive
to do a DNS lookup on the host first to populate its DNS mapping.
The arguments matches Node dns module lookup.
instance.clearDnsCache()
- Wipes out current DNS mapping.
instance.getName(options)
The internal method to override http agent's default getName
. Not intended for public use.
[0.2.1]
FAQs
Forked from electrode-keepalive
The npm package async-keepalive receives a total of 1 weekly downloads. As such, async-keepalive popularity was classified as not popular.
We found that async-keepalive demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.