proxy-basic-auth
v1.0.12
Published
> example
Downloads
3
Readme
proxy-auth
example
const proxyAuth = require('proxy-auth');
proxyAuth.setAddr("http://proxy.xx.xx:8888");
proxyAuth.setUser("scott");
proxyAuth.setPsw("12345678");
http.globalAgent = proxyAuth;
// or
http.get("http://www.google.com", { agent: proxyAuth}, stdout)
function stdout(res) {
console.log('statusCode:', res.statusCode);
console.log('headers:', res.headers);
res.on('data', chunk => {
process.stdout.write(chunk)
})
}