From f57b1bf47961f0d39c690887cf9a2e6941fb1276 Mon Sep 17 00:00:00 2001 From: Uman Shahzad Date: Mon, 16 Nov 2026 16:16:39 +0500 Subject: [PATCH] feat(ip): add InternetData to the IP API list (#10614) --- v2rayN/ServiceLib/Global.cs | 1 + v2rayN/ServiceLib/Handler/ConnectionHandler.cs | 2 +- v2rayN/ServiceLib/Models/Dto/IPAPIInfo.cs | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) 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)