proxies.map((proxy) => { try { let url = new URL.URL(proxy); url.protocol = "http:"; // Force HTTP protcol return url.href; } catch { if (!proxy.startsWith("http://")) { proxy = "http://" + proxy; } return proxy; } })
function detectMiner(request, url){ let flag = false; // ignore results of redirect - TODO const reqURL = new URL(request.url()); if(online_miners.includes(reqURL.host)){ flag = true; culprit_hosts.push(new URL(url).host); console.info(`${url} => ${reqURL.href}`); writeFile(config.output_file, {url: url, msg: ` => Found using ${reqURL}`}); } return flag; }