
Hi, hoping someone can help.
When applying a proxy, the resulting IP will appear in HTTP sniffer automatically. Is there a way to save this output straight to a variable i.e. set a variable [[WHATSMYIP]] and save HTTP sniffer IP result.
Or is there a recommended approach?
If not, can anyone help improve on this Javascript
var request = new XMLHttpRequest();
var websites = [
'https://api.ipify.org',
'https://checkip.amazonaws.com/',
'https://ipapi.co/ip/',
'https://ip-addr.es/',
'https://api.ip.sb/ip',
'https://curlmyip.net/',
'https://api.myip.la/'
];
for (var i = 0; i < websites.length; i++) {
var url = websites[i];
request.open('GET', url, false);
try {
request.send(null);
} catch (err) {
console.log('Error occurred: ' + err);
continue;
}
if (request.status === 200 && request.responseText !== null) {
[[WHATSMYIP]] = request.responseText;
break;
}
}
It's worked reliably for months, but now I'm getting the occasional "Timeout during script2 for[documentRoot]" on certain proxies, so I'm not sure if it's error handling and checking all of the IP sites before failing.
Thanks