首页 > 解决方案 > 使用代理时出现 AssertionError

问题描述

我正在使用代理列表在nodejs中进行请求有我的代码

request.get({
    url: 'https://google.com',
    proxy: proxy[i],
    timeout: 1000
  }, function(err, res, body){
    console.log(err)
  })

我有 100 个代理,其中一些给我这个错误,例如这个代理 89.20.135.204:80

assert.js:42
  throw new errors.AssertionError({
  ^

AssertionError [ERR_ASSERTION]: 5 == 0
    at ClientRequest.onConnect (/Users/admin/Desktop/files/node_modules/tunnel-agent/index.js:160:14)

我该如何处理?if(err) next proxy ,没有帮助

标签: node.jsproxyrequest

解决方案


推荐阅读