proxy
dallascao opened this issue · comments
dallascao commented
For anyone who wonders how to use https with a proxy, you can do it through proxy-agent:
const proxy = require('proxy-agent');
const httpx = require('httpx');
httpx.request('http://www.baidu.com/', {agent: new ProxyAgent("https://yourproxy:123")}).then((response) => {
response.pipe(process.stdout);
response.on('end', () => {
process.stdout.write('\n');
});
}, (err) => {
// on error
});
Jackson Tian commented
bingo
Jackson Tian commented
I will add it into readme. Thank you.