var tabProxy = new Array(
'122.72.76.122'
,'124.240.187.79'
);
http.get ({
host: tabProxy[selectorProxy],
port: 80,
path: baseurl + counter
}, function (response) {
try{
var statusCode = response.statusCode;
console.log (statusCode);
}catch(e){
console.log(e);
}
})
选择器代理=0;它可以工作,但 selectorProxy = 1; 应用程序崩溃:
events.js:72
throw er; // Unhandled 'error' event
^
Error: socket hang up
at createHangUpError (http.js:1417:15)
at Socket.socketOnEnd [as onend] (http.js:1513:23)
at Socket.g (events.js:175:14)
at Socket.EventEmitter.emit (events.js:117:20)
at _stream_readable.js:870:14
at process._tickCallback (node.js:415:13)
如何弥补这个错误(提取我的数组的这个 ip)?尝试捕获不起作用!