Change IP lookup provider
This commit is contained in:
parent
518cb0fc77
commit
78a357b164
8
cli.js
8
cli.js
@ -1417,11 +1417,11 @@ async function init({ rpc, noteNetId, currency = 'dai', amount = '100', balanceC
|
|||||||
|
|
||||||
if (!isIpPrivate && !rpc.includes('localhost') && !privateRpc) {
|
if (!isIpPrivate && !rpc.includes('localhost') && !privateRpc) {
|
||||||
try {
|
try {
|
||||||
const fetchRemoteIP = await axios.get('https://ip.tornado.cash', ipOptions);
|
const htmlIPInfo = await axios.get("https://check.torproject.org", ipOptions);
|
||||||
const { country, ip } = fetchRemoteIP.data;
|
const ip = htmlIPInfo.data.split("Your IP address appears to be: <strong>").pop().split("</")[0];
|
||||||
console.log('Your remote IP address is', ip, 'from', country + '.');
|
console.log('Your remote IP address is', ip);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Could not fetch remote IP from ip.tornado.cash, use VPN if the problem repeats.');
|
console.error('Could not fetch remote IP from check.torproject.org, use VPN if the problem repeats.');
|
||||||
}
|
}
|
||||||
} else if (isIpPrivate || rpc.includes('localhost')) {
|
} else if (isIpPrivate || rpc.includes('localhost')) {
|
||||||
console.log('Local RPC detected');
|
console.log('Local RPC detected');
|
||||||
|
Loading…
Reference in New Issue
Block a user