global-agent-ng
v1.0.0
Published
Opinionated wrapper around `global-agent`
Downloads
15
Maintainers
Readme
global-agent-ng
Opinionated wrapper around
global-agent
Installation
npm install global-agent-ng
Usage
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.js
Configure global-agent-ng
using environment variables
The following environment variables are respected by global-agent-ng
:
HTTP_PROXY
/http_proxy
HTTPS_PROXY
/https_proxy
NO_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
options
ProxyAgentConfig 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();
//=> false
Returns Boolean bootstraping result