I am working on a proxy checker and have the following code to run requests at intervals of approximately 5 seconds using the setTimeout function;
function check() {
var url = document.getElementById('url').value;
var proxys = document.getElementById('proxys').value.replace(/\n/g,',');
var proxys = proxys.split(",");
for (proxy in proxys) {
var proxytimeout = proxy*5000;
t = setTimeout(doRequest, proxytimeout, url, proxys[proxy]);
}
}
However, I can not stop them after they start!
function stopcheck() {
clearTimeout(t);
}
A corrected or better method will be more appreciated.
Thank qaru community
source
share