1.0.0 • Published 5 years ago
global-agent-ng v1.0.0
global-agent-ng
Opinionated wrapper around
global-agent
Installation
npm install global-agent-ngUsage
As early as possible in your application, require and configure global-agent-ng.
require('global-agent-ng').config();Preload
You can use the -r, --require command line option to preload global-agent-ng. By doing this, you do not need to require and load global-agent-ng in your application code.
node -r global-agent-ng/config script.jsConfigure global-agent-ng using environment variables
The following environment variables are respected by global-agent-ng:
HTTP_PROXY/http_proxyHTTPS_PROXY/https_proxyNO_PROXY/no_proxy
API
Table of Contents
exports.agent
global proxy agent instance
Type: ProxyAgent
exports.isProxying
proxying status
Type: Boolean
config
Bootstrap global proxy agent
Parameters
optionsProxyAgentConfig global proxy agent configuration
Examples
// Bootstrap global proxy agent
require('global-agent-ng').config();
//=> true
// Global proxy agent is already bootstrapped
require('global-agent-ng').config();
//=> falseReturns Boolean bootstraping result
ProxyAgentConfig
ProxyAgent
1.0.0
5 years ago