httpx-proxy-agent-config
A Node proxy definition for http/https with proxy and blacklist/whitelist configuration
Installation
$ npm install bloublou2014/httpx-proxy-agent-config
Quick Start
var proxy = ; proxy; // try to access a page via http request :var http = ;http; // try to access a page via https requestvar https = ;https;
API Reference
.install(Object configuration)
Install proxy on http and https if configuration available.
Configuration options :
- http_proxy : set http proxy like 'http://1.2.3.4:3128'
- https_proxy : set https proxy like 'http://1.2.3.4:3128'
- whitelist : a list of domains or IPs to proxy, otherwise request is done by system.
- blacklist : a list of domains or IPs to not proxy, otherwise request is done via proxy.
Note : whitelist and blacklist can't be used at the same time. Only set one list.
Currently white/blacklist only support string (no regex).
.uninstall()
Restore previous agent and http(s).request functions
.config()
Returns current configuration