nodejs http代理请求

时间:2018-06-21 16:28:38   收藏:0   阅读:1194

一些免费到代理地址

http://www.xicidaili.com/nn

https://proxy.l337.tech/txt

http://www.66ip.cn/mo.php?sxb=&tqsl=100&port=&export=&ktip=&sxa=&submit=%CC%E1++%C8%A1&textarea=http%3A%2F%2Fwww.66ip.cn%2F%3Fsxb%3D%26tqsl%3D100%26ports%255B%255D2%3D%26ktip%3D%26sxa%3D%26radio%3Dradio%26submit%3D%25CC%25E1%2B%2B%25C8%25A1

 

以下代码测试你是否代理成功

 request({
        method: ‘GET‘,
        url: ‘http://ip.chinaz.com/getip.aspx‘,
        timeout: 8000,
        encoding: null,
        proxy: ‘http://91.205.239.120:8080‘
    }, function (err, _res, body) {
        if (err) throw new Error(err)
        body = body.toString();
        console.log(body);
    })

 

原文:https://www.cnblogs.com/CyLee/p/9209301.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!