@bjowes/keepalive-proxy-agent
v1.0.2
Published
proxy agent that honors keepalive. Scoped release to make recent code available through npm. Only intended for cypress-ntlm-auth, use at your own risk.
Downloads
2
Readme
node-keepalive-proxy-agent
Scoped release to make recent code available through npm. Please use the original repo if possible. Only intended for cypress-ntlm-auth, use at your own risk.
features
- working keepalive
- option to allow self-signed servers
- basic auth for proxy authentication
- 60 lines of code (100% code coverage)
installation
npm install keepalive-proxy-agent
examples
using the https_proxy or HTTP_PROXY environment variables
let https = require('https')
let Agent = require('keepalive-proxy-agent')
let agent = new Agent ()
let options = {hostname: 'google.de', port: 443, agent: agent}
https.get(options, (resp) => resp.pipe(process.stdout))
using provided proxy
...
let agent = new Agent ({proxy:{hostname:"MYPROXYHOST",port:3128}})
...
connect to self-signed-server over proxy
...
let options = {hostname: 'google.de', port: 443, agent: agent, rejectUnauthorized: false}
...
allow proxy authentication
...
let agent = new Agent ({proxy:{hostname:"MYPROXYHOST",port:3128, auth:"USER:PASS"}})
...
caveat
- use hostname+port, not host+port, see https://nodejs.org/api/url.html#url_url_strings_and_url_objects for details