{"library":"proxy-http-agent","title":"ProxyHttpAgent","description":"ProxyHttpAgent (v1.0.1) is a factory for creating HTTP proxy agents supporting https→(http, https) and http→(http, https) tunneling, built on top of the node-tunnel module. It allows you to easily use proxies with http/https modules or node-fetch, with flexible proxy configuration via URL or object. Published as TypeScript-first with built-in type definitions, it exports `getProxyHttpAgent` along with `HttpsAgent` and `HttpAgent` types. Released in 2025, it is currently at stable v1. It differentiates by offering a simple API for creating agents that support both secure and insecure proxy connections with minimal boilerplate.","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install proxy-http-agent"],"cli":null},"imports":["import { getProxyHttpAgent } from 'proxy-http-agent'","import { HttpsAgent } from 'proxy-http-agent'","import { HttpAgent } from 'proxy-http-agent'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { getProxyHttpAgent } from 'proxy-http-agent';\nimport https from 'https';\n\nconst proxyUrl = process.env.HTTP_PROXY ?? 'http://localhost:3128';\nconst agent = getProxyHttpAgent({\n  proxy: proxyUrl,\n  rejectUnauthorized: false\n});\n\nconst options = {\n  hostname: 'example.com',\n  port: 443,\n  path: '/',\n  agent\n};\n\nhttps.get(options, (res) => {\n  let data = '';\n  res.on('data', chunk => data += chunk);\n  res.on('end', () => console.log(data));\n}).on('error', (err) => console.error(err));","lang":"typescript","description":"Creating a proxy agent with proxy URL from environment and using it with https.get.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}