Skip to main content

What is an HTTP agent in Node.js?

Mid NodeJS
Quick Answer An HTTP Agent manages connection pooling for outgoing HTTP requests รขโ‚ฌโ€ it maintains a pool of keep-alive TCP connections to the same server instead of creating a new TCP connection per request. Reusing connections avoids the TCP and TLS handshake overhead. In production, configure maxSockets to tune how many connections your app maintains per host.

Answer

An HTTP agent manages and reuses TCP connections, improving the performance of outgoing HTTP requests.
S
SugharaIQ Editorial Team Verified Answer

This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice