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 any Duplex stream, or another http.Agent instance to delegate the request
  • connect() can be an async function
  • opts.secureEndpoint is used to distinguish between HTTP / HTTPS

Quick Start

Installs
3
Repository
openlark/skills
GitHub Stars
4
First Seen
Aug 8, 2026
agent-base — openlark/skills