
Security News
OWASP 2025 Top 10 Adds Software Supply Chain Failures, Ranked Top Community Concern
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.
@balena/eye-patch
Advanced tools
This package patches `http(s).Agent` to implement "happy eyeballs" ([rfc8305](https://datatracker.ietf.org/doc/html/rfc8305)), a standard published by the IETF.
This package patches http(s).Agent to implement "happy eyeballs" (rfc8305), a standard published by the IETF.
It improves client performance and reliability by trying concurrently trying multiple ip addresses for a given host name. See Explanation for more detail.
npm i --save-dev @balena/eye-patch
To use this library, simply import the module, and the prototype of http.Agent.createConnection and https.Agent.createConnection will be replaced.
import '@balena/eye-patch';
If you want to be more explicit, you can explicitly patch the http(s).Agent:
import { patch } from '@balena/eye-patch';
import { Agent as HttpAgent } from 'http';
import { Agent as HttpsAgent } from 'https';
patch(HttpAgent);
patch(HttpsAgent);
Although, this is exactly what the import '@balena/eye-patch/explicit'; does anyway.
You could also implement your own agent and replace the createConnection method:
import { createConnection } from '@balena/eye-patch/explicit';
import { Agent as HttpAgent } from 'http';
import { Agent as HttpsAgent } from 'https';
export class MyHttpAgent extends HttpAgent {
createConnection = createConnection;
}
export class MyHttpsAgent extends HttpsAgent {
createConnection = createConnection;
}
This does basically the same thing as the previous examples though.
Essentially, the algorithm amounts to this:
1.0.0 - 2021-09-30
FAQs
This package patches `http(s).Agent` to implement "happy eyeballs" ([rfc8305](https://datatracker.ietf.org/doc/html/rfc8305)), a standard published by the IETF.
We found that @balena/eye-patch demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers 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.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.