agent-base
Installation
SKILL.md
agent-base — Custom HTTP Agent Helper
Helps users create custom http.Agent subclasses based on the agent-base module, for scenarios such as HTTP request proxying, custom socket connections, etc.
Trigger Scenarios
Use when the user needs to write HTTP/HTTPS/SOCKS/PAC proxies, custom HTTP connection logic, or extend http.Agent.
Module Overview
agent-base wraps an ordinary function into an http.Agent instance. It is an abstract class that requires defining the connect(req, opts) method to create the underlying Socket.
connect()can return anyDuplexstream, or anotherhttp.Agentinstance to delegate the requestconnect()can be anasyncfunctionopts.secureEndpointis used to distinguish between HTTP / HTTPS