Modern rewrite of TooTallNate's proxy-agents ecosystem.
One package replaces 9:
| Original | Status |
|---|---|
| agent-base | β Integrated |
| https-proxy-agent | β Integrated |
| http-proxy-agent | β Integrated |
| socks-proxy-agent | β Integrated |
| proxy-agent | β Integrated |
| pac-proxy-agent | β Integrated |
| pac-resolver | β Integrated |
| get-uri | β Integrated |
| data-uri-to-buffer | β Integrated |
| Package | Description |
|---|---|
| @modern-proxy/core | Unified proxy agent with HTTP, SOCKS, PAC support |
npm install @modern-proxy/coreimport { ProxyAgent } from '@modern-proxy/core';
// Auto-detect from environment
const agent = new ProxyAgent();
// Or specify proxy
const agent = new ProxyAgent({ proxy: 'http://proxy:8080' });
const agent = new ProxyAgent({ proxy: 'socks5://127.0.0.1:9050' });
// Use with fetch
await fetch('https://api.example.com', { agent });Import only what you need:
// Only HTTP proxy (~6KB)
import { HttpsProxyAgent } from '@modern-proxy/core/http';
// Only SOCKS proxy (~6KB)
import { SocksProxyAgent } from '@modern-proxy/core/socks';
// Only PAC support
import { PacProxyAgent } from '@modern-proxy/core/pac';
// Auto-detect from env
import { ProxyAgent } from '@modern-proxy/core/auto';MIT