proxy agent that honors keepal

node-keepalive-proxy-agent

features working keepalive option to allow self-signed servers basic auth for proxy authentication 60 lines of code (100% code coverage) only works with https requests (proxy can be http or https) 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:{host:"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:{host:"MYPROXYHOST",port:3128, auth:"USER:PASS"}}) ...

版权声明:

1、该文章(资料)来源于互联网公开信息,我方只是对该内容做点评,所分享的下载地址为原作者公开地址。
2、网站不提供资料下载,如需下载请到原作者页面进行下载。