Closed cyclops24 closed 8 years ago
That is probably a bug.
@chill117 Thanks man for rapidly comment. :smile: You are awesome. :wink:
@chill117 Maybe it's about testAll
function, because I used testProtocol
before without any issue with same proxy list.
For example this code works fine without any issue:
ProxyVerifier.testProtocol(proxyObj, Meteor.bindEnvironment((error, result) => {
if (error) {
// Some unusual error occurred.
} else {
if (result.ok) {
Proxies.update({_id: proxy._id}, {$inc: {point: 1}});
} else {
Proxies.update({_id: proxy._id}, {$inc: {point: -1}});
}
}
}));
Yes, that is most likely. I was working on some improvements (mostly with stability) for testAll and other functions. But I haven't had a chance to finish the changes yet.
So I wait for new release man. :wink:
@chill117 I convert my code to below and again same error accord:
ProxyVerifier.testProtocol(proxyObj, Meteor.bindEnvironment((error, result) => {
if (error) {
// Some unusual error occurred.
} else {
if (result.ok) {
ProxyVerifier.testAnonymityLevel(proxyObj, Meteor.bindEnvironment((error, anonymityLevel) => {
if (error) {
// Some unusual error occurred.
} else {
// anonymityLevel will be a string equal to "transparent", "anonymous", or "elite".
if (anonymityLevel === "elite") {
Proxies.update({_id: proxy._id}, {$inc: {point: 1}});
} else {
Proxies.update({_id: proxy._id}, {$inc: {point: -1}});
}
}
}));
}
else {
Proxies.update({_id: proxy._id}, {$inc: {point: -1}});
}
}
}));
I guess this issue also related to testAnonymityLevel
function too.
@chill117 when you want to fix this or push your past changes?
Not sure when I will have time for this. Could be a week or so.
Thanks man so I can wait for it :wink:
+1, same problem here.
+1 same problem here, this is my code:
const ProxyLists = require('proxy-lists');
const ProxyVerifier = require('proxy-verifier');
// `gettingProxies` is an event emitter object.
var gettingProxies = ProxyLists.getProxies();
var proxies = [];
function pushItemsToArray(data_array, target_array) {
data_array.forEach(function (item) {
target_array.push(item);
});
}
function checkProxies(proxies) {
proxies.forEach(function (proxy) {
ProxyVerifier.testAll(proxy, function (error, result) {
if (error) {
console.log(error);
} else {
console.log(result);
}
});
});
}
gettingProxies.on('data', function (raw_proxies) {
// Received some proxies.
console.log("aye");
pushItemsToArray(raw_proxies, proxies);
});
gettingProxies.on('error', function (error) {
// Some error has occurred.
console.error(error);
});
gettingProxies.once('end', function () {
// Done getting proxies.
checkProxies(proxies);
});
thanks for a amazing library by the way! 👍 :)
This issue has been fixed upstream in the proxy-lists module.
Hi @chill117, I used this code and sometimes it's return below error and app server restarted at all:
This is my code:
Do you have any suggestion?? My code is wrong or it's a bug?