mirror of
https://github.com/2dust/v2rayN.git
synced 2026-11-16 17:35:01 +03:00
feat(ip): add InternetData to the IP API list (#10614)
This commit is contained in:
@@ -724,6 +724,7 @@ public class Global
|
|||||||
@"https://api-ipv4.ip.sb/geoip",
|
@"https://api-ipv4.ip.sb/geoip",
|
||||||
@"https://api-ipv6.ip.sb/geoip",
|
@"https://api-ipv6.ip.sb/geoip",
|
||||||
@"https://api.ipapi.is",
|
@"https://api.ipapi.is",
|
||||||
|
@"https://api.internetdata.io/myip",
|
||||||
@""
|
@""
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ public static class ConnectionHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
var ip = ipInfo.ip ?? ipInfo.clientIp ?? ipInfo.ip_addr ?? ipInfo.query;
|
var ip = ipInfo.ip ?? ipInfo.clientIp ?? ipInfo.ip_addr ?? ipInfo.query;
|
||||||
var country = ipInfo.country_code ?? ipInfo.country ?? ipInfo.countryCode ?? ipInfo.location?.country_code ?? "unknown";
|
var country = ipInfo.country_code ?? ipInfo.country ?? ipInfo.countryCode ?? ipInfo.location?.country_code ?? ipInfo.location?.country ?? "unknown";
|
||||||
|
|
||||||
return new IpInfoResult(country, ip);
|
return new IpInfoResult(country, ip);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ internal class IPAPIInfo
|
|||||||
public class LocationInfo
|
public class LocationInfo
|
||||||
{
|
{
|
||||||
public string? country_code { get; set; }
|
public string? country_code { get; set; }
|
||||||
|
public string? country { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public readonly record struct IpInfoResult(string Country, string? Ip)
|
public readonly record struct IpInfoResult(string Country, string? Ip)
|
||||||
|
|||||||
Reference in New Issue
Block a user