我正在使用 node.js 的 request 模块,但不时地(仅在生产环境中,可能是在 node.js 更新后)会遇到未捕获的错误。
Node 版本:0.12.4,request 版本:2.55.0
可以成功执行 1000-2000 个请求,但之后就会出现此类错误:
Error: Protocol "http:" not supported. Expected "https:".
at new ClientRequest (_http_client.js:75:11)
at Object.exports.request (http.js:49:10)
at Request.start (/path/node_modules/request/request.js:963:30)
at Request.end (/path/node_modules/request/request.js:1531:10)
at end (/path/node_modules/request/request.js:734:14)
at Immediate._onImmediate (/path/node_modules/request/request.js:748:7)
at processImmediate [as _immediateCallback] (timers.js:358:17)"
我该如何修复它?为什么会出现这个问题?谢谢 :)