UNPKG

global-proxy-agent

Version:

A universal proxy agent for Node.js that combines environment-variable-based proxy resolution with smart protocol-aware agent selection. Automatically supports HTTP, HTTPS, SOCKS, and PAC proxies using a modular, runtime-configurable approach. It also pro

13 lines (12 loc) 444 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createSmartProxyAgent = createSmartProxyAgent; const proxy_agent_1 = require("proxy-agent"); const logger_1 = require("../config/logger"); function createSmartProxyAgent(options) { const agent = new proxy_agent_1.ProxyAgent({ timeout: options?.timeout ?? 60000, }); logger_1.logger.debug('Created smart proxy agent.'); return agent; }