Skip to content

Instantly share code, notes, and snippets.

@lxneng
Created July 12, 2019 06:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lxneng/9419db0c479e89793da0dd4ef9edc37e to your computer and use it in GitHub Desktop.
Save lxneng/9419db0c479e89793da0dd4ef9edc37e to your computer and use it in GitHub Desktop.
axios over https proxy agent
const axios = require('axios');
const httpsProxyAgent = require('https-proxy-agent');
axios({
url: 'https://mp.weixin.qq.com/s?__biz=MjM5MjA5NTk0MA==&mid=2652614878&idx=1&sn=2f04cadcc65d38767f8b549f454c895e&chksm=bd449b758a3312631e1eb6a02f9c285b8b90871a18bd7f28c7cfc17bd820d8dbdc06b9669cfa&scene=27#wechat_redirect',
httpsAgent: new httpsProxyAgent('http://61.128.208.94:3128')
}).then((res) => {
console.log(res.data);
}).catch((err) => {
console.log(err);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment