我正在尝试在循环内部计算某些散列时发送HTTP请求,但请求失败而没有任何错误。我试图在循环之外运行代码,它运行了!
for(var i=startFrom;i<startFrom+blockSize;i++){
var hash = crypto.createHash('sha256').update(username+i).digest('hex');
if(hash.indexOf(kZeros)==0){
var hashRespOptions = {
host: ipAddr,
agent: false,
port: hashResponsePort,
path: '/?shaString='+i+'&shaHash='+hash
};
http.request(hashRespOptions,function(){}).end();
console.log(hashRespOptions);
}
requestWork();
}