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
11 lines (10 loc) • 367 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.setGlobalProxy = setGlobalProxy;
function setGlobalProxy(proxyUrl) {
const globalAgent = global.GLOBAL_AGENT;
if (!globalAgent) {
throw new Error('GLOBAL_AGENT is not initialized. Call setupGlobalProxyAgent() first.');
}
globalAgent.HTTP_PROXY = proxyUrl;
}