diff --git a/v2rayN/ServiceLib/Global.cs b/v2rayN/ServiceLib/Global.cs index 7b9c0623..e3153aff 100644 --- a/v2rayN/ServiceLib/Global.cs +++ b/v2rayN/ServiceLib/Global.cs @@ -724,6 +724,7 @@ public class Global @"https://api-ipv4.ip.sb/geoip", @"https://api-ipv6.ip.sb/geoip", @"https://api.ipapi.is", + @"https://api.internetdata.io/myip", @"" ]; diff --git a/v2rayN/ServiceLib/Handler/ConnectionHandler.cs b/v2rayN/ServiceLib/Handler/ConnectionHandler.cs index d9c1d2b8..a48bb1d3 100644 --- a/v2rayN/ServiceLib/Handler/ConnectionHandler.cs +++ b/v2rayN/ServiceLib/Handler/ConnectionHandler.cs @@ -133,7 +133,7 @@ public static class ConnectionHandler } 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); } diff --git a/v2rayN/ServiceLib/Models/Dto/IPAPIInfo.cs b/v2rayN/ServiceLib/Models/Dto/IPAPIInfo.cs index 0257ab67..19639757 100644 --- a/v2rayN/ServiceLib/Models/Dto/IPAPIInfo.cs +++ b/v2rayN/ServiceLib/Models/Dto/IPAPIInfo.cs @@ -16,6 +16,7 @@ internal class IPAPIInfo public class LocationInfo { public string? country_code { get; set; } + public string? country { get; set; } } public readonly record struct IpInfoResult(string Country, string? Ip)