fixed IPv6 geolocation

This commit is contained in:
aglkm
2026-03-20 01:43:53 +03:00
parent 88a2b74af6
commit 222ca60362
+2 -1
View File
@@ -862,7 +862,8 @@ pub async fn get_reachable_nodes(netstats: Arc<Mutex<NetStats>>) -> Result<(), a
match TcpStream::connect_timeout(&socket_addr, Duration::from_millis(3000)) {
Ok(_) => {
let client = reqwest::Client::new();
if let Some((ip, _port)) = node.address.split_once(':') {
if let Some((addr, _port)) = node.address.split_once(':') {
let ip = addr.trim_matches(|c| c == '[' || c == ']');
//let url = format!("https://api.country.is/{}", ip);
let url = format!("http://ip-api.com/json/{}", ip);