mirror of
https://github.com/2dust/v2rayN.git
synced 2026-11-01 10:05:00 +03:00
Node check (#9603)
This commit is contained in:
@@ -728,6 +728,12 @@ public class Utils
|
|||||||
.Any(ua => ua.Address.Equals(targetAddress));
|
.Any(ua => ua.Address.Equals(targetAddress));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static bool ContainsInterfaceName(string inInterfaceName)
|
||||||
|
{
|
||||||
|
return NetworkInterface.GetAllNetworkInterfaces()
|
||||||
|
.Any(ni => ni.Name.Equals(inInterfaceName, StringComparison.OrdinalIgnoreCase));
|
||||||
|
}
|
||||||
|
|
||||||
#endregion Speed Test
|
#endregion Speed Test
|
||||||
|
|
||||||
#region Miscellaneous
|
#region Miscellaneous
|
||||||
|
|||||||
@@ -96,17 +96,39 @@ public class CoreConfigContextBuilder
|
|||||||
}
|
}
|
||||||
if (context.IsTunEnabled && context.AppConfig.TunModeItem.RouteExcludeAddress is { Count: > 0 })
|
if (context.IsTunEnabled && context.AppConfig.TunModeItem.RouteExcludeAddress is { Count: > 0 })
|
||||||
{
|
{
|
||||||
|
var appConfig = JsonUtils.DeepCopy(config);
|
||||||
|
var routeExcludeAddressList = new List<string>();
|
||||||
foreach (var addr in context.AppConfig.TunModeItem.RouteExcludeAddress)
|
foreach (var addr in context.AppConfig.TunModeItem.RouteExcludeAddress)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
IPNetwork2.Parse(addr);
|
IPNetwork2.Parse(addr);
|
||||||
|
routeExcludeAddressList.Add(addr);
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
validatorResult.Errors.Add(string.Format(ResUI.MsgTunRouteExcludeInvalidAddress, addr));
|
validatorResult.Warnings.Add(string.Format(ResUI.MsgTunRouteExcludeInvalidAddress, addr));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
appConfig.TunModeItem.RouteExcludeAddress = routeExcludeAddressList;
|
||||||
|
context = context with { AppConfig = appConfig };
|
||||||
|
}
|
||||||
|
if (!context.AppConfig.CoreBasicItem.SendThrough.IsNullOrEmpty()
|
||||||
|
&& !Utils.IsLocalIP(context.AppConfig.CoreBasicItem.SendThrough))
|
||||||
|
{
|
||||||
|
validatorResult.Warnings.Add(string.Format(ResUI.MsgInvalidProperty, ResUI.TbSettingsSendThrough));
|
||||||
|
var appConfig = JsonUtils.DeepCopy(config);
|
||||||
|
appConfig.CoreBasicItem.SendThrough = string.Empty;
|
||||||
|
context = context with { AppConfig = appConfig };
|
||||||
|
}
|
||||||
|
if (!context.AppConfig.CoreBasicItem.BindInterface.IsNullOrEmpty()
|
||||||
|
&& (!Utils.ContainsInterfaceName(context.AppConfig.CoreBasicItem.BindInterface)
|
||||||
|
|| !(context.IsTunEnabled || context.IsWindows)))
|
||||||
|
{
|
||||||
|
validatorResult.Warnings.Add(string.Format(ResUI.MsgInvalidProperty, ResUI.TbSettingsBindInterface));
|
||||||
|
var appConfig = JsonUtils.DeepCopy(config);
|
||||||
|
appConfig.CoreBasicItem.BindInterface = string.Empty;
|
||||||
|
context = context with { AppConfig = appConfig };
|
||||||
}
|
}
|
||||||
|
|
||||||
return new CoreConfigContextBuilderResult(context, validatorResult);
|
return new CoreConfigContextBuilderResult(context, validatorResult);
|
||||||
|
|||||||
@@ -43,8 +43,8 @@ public class NodeValidator
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Basic Property Validation
|
// Basic Property Validation
|
||||||
v.Assert(!item.Address.IsNullOrEmpty(), string.Format(ResUI.MsgInvalidProperty, "Address"));
|
v.Assert(!item.Address.IsNullOrEmpty(), string.Format(ResUI.MsgInvalidProperty, ResUI.TbAddress));
|
||||||
v.Assert(item.Port is > 0 and <= 65535, string.Format(ResUI.MsgInvalidProperty, "Port"));
|
v.Assert(item.Port is > 0 and <= 65535, string.Format(ResUI.MsgInvalidProperty, ResUI.TbPort));
|
||||||
|
|
||||||
// Network & Core Logic
|
// Network & Core Logic
|
||||||
var net = item.GetNetwork();
|
var net = item.GetNetwork();
|
||||||
@@ -75,25 +75,25 @@ public class NodeValidator
|
|||||||
{
|
{
|
||||||
case EConfigType.VMess:
|
case EConfigType.VMess:
|
||||||
v.Assert(!item.Password.IsNullOrEmpty() && Utils.IsGuidByParse(item.Password),
|
v.Assert(!item.Password.IsNullOrEmpty() && Utils.IsGuidByParse(item.Password),
|
||||||
string.Format(ResUI.MsgInvalidProperty, "Password"));
|
string.Format(ResUI.MsgInvalidProperty, ResUI.TbId));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EConfigType.VLESS:
|
case EConfigType.VLESS:
|
||||||
v.Assert(
|
v.Assert(
|
||||||
!item.Password.IsNullOrEmpty()
|
!item.Password.IsNullOrEmpty()
|
||||||
&& (Utils.IsGuidByParse(item.Password) || item.Password.Length <= 30),
|
&& (Utils.IsGuidByParse(item.Password) || item.Password.Length <= 30),
|
||||||
string.Format(ResUI.MsgInvalidProperty, "Password")
|
string.Format(ResUI.MsgInvalidProperty, ResUI.TbId5)
|
||||||
);
|
);
|
||||||
v.Assert(Global.Flows.Contains(protocolExtra.Flow ?? string.Empty),
|
v.Assert(Global.Flows.Contains(protocolExtra.Flow ?? string.Empty),
|
||||||
string.Format(ResUI.MsgInvalidProperty, "Flow"));
|
string.Format(ResUI.MsgInvalidProperty, ResUI.TbFlow5));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EConfigType.Shadowsocks:
|
case EConfigType.Shadowsocks:
|
||||||
v.Assert(!item.Password.IsNullOrEmpty(), string.Format(ResUI.MsgInvalidProperty, "Password"));
|
v.Assert(!item.Password.IsNullOrEmpty(), string.Format(ResUI.MsgInvalidProperty, ResUI.TbId3));
|
||||||
v.Assert(
|
v.Assert(
|
||||||
!string.IsNullOrEmpty(protocolExtra.SsMethod) &&
|
!string.IsNullOrEmpty(protocolExtra.SsMethod) &&
|
||||||
Global.SsSecuritiesInSingbox.Contains(protocolExtra.SsMethod),
|
Global.SsSecuritiesInSingbox.Contains(protocolExtra.SsMethod),
|
||||||
string.Format(ResUI.MsgInvalidProperty, "SsMethod"));
|
string.Format(ResUI.MsgInvalidProperty, ResUI.TbSecurity3));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -115,10 +115,11 @@ public class NodeValidator
|
|||||||
// TLS & Security
|
// TLS & Security
|
||||||
if (item.StreamSecurity == Global.StreamSecurity)
|
if (item.StreamSecurity == Global.StreamSecurity)
|
||||||
{
|
{
|
||||||
if (!item.Cert.IsNullOrEmpty() && CertPemManager.ParsePemChain(item.Cert).Count == 0 &&
|
var isCertProvided = !item.Cert.IsNullOrEmpty();
|
||||||
!item.CertSha.IsNullOrEmpty())
|
if (!item.Cert.IsNullOrEmpty() && CertPemManager.ParsePemChain(item.Cert).Count == 0)
|
||||||
{
|
{
|
||||||
v.Error(string.Format(ResUI.MsgInvalidProperty, "TLS Certificate"));
|
v.Error(string.Format(ResUI.MsgInvalidProperty, ResUI.TbFullCertTips));
|
||||||
|
isCertProvided = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for deprecated allowInsecure property when TLS is enabled
|
// Check for deprecated allowInsecure property when TLS is enabled
|
||||||
@@ -131,19 +132,19 @@ public class NodeValidator
|
|||||||
|
|
||||||
if ((coreType == ECoreType.Xray
|
if ((coreType == ECoreType.Xray
|
||||||
&& item.GetAllowInsecure()
|
&& item.GetAllowInsecure()
|
||||||
&& item.Cert.IsNullOrEmpty()
|
&& !isCertProvided
|
||||||
&& item.CertSha.IsNullOrEmpty())
|
&& item.CertSha.IsNullOrEmpty())
|
||||||
|| (coreType == ECoreType.sing_box
|
|| (coreType == ECoreType.sing_box
|
||||||
&& item.GetAllowInsecure()
|
&& item.GetAllowInsecure()
|
||||||
&& item.Cert.IsNullOrEmpty()))
|
&& !isCertProvided))
|
||||||
{
|
{
|
||||||
v.Warning("Insecure configuration detected: AllowInsecure is enabled but no certificate is provided. This may cause MITM attacks.");
|
v.Warning(ResUI.MsgInsecureConfiguration);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.StreamSecurity == Global.StreamSecurityReality)
|
if (item.StreamSecurity == Global.StreamSecurityReality)
|
||||||
{
|
{
|
||||||
v.Assert(!item.PublicKey.IsNullOrEmpty(), string.Format(ResUI.MsgInvalidProperty, "PublicKey"));
|
v.Assert(!item.PublicKey.IsNullOrEmpty(), string.Format(ResUI.MsgInvalidProperty, ResUI.TbPublicKey));
|
||||||
}
|
}
|
||||||
|
|
||||||
var transport = item.GetTransportExtra();
|
var transport = item.GetTransportExtra();
|
||||||
@@ -151,7 +152,7 @@ public class NodeValidator
|
|||||||
{
|
{
|
||||||
if (JsonUtils.ParseJson(transport.XhttpExtra) is not JsonObject)
|
if (JsonUtils.ParseJson(transport.XhttpExtra) is not JsonObject)
|
||||||
{
|
{
|
||||||
v.Error(string.Format(ResUI.MsgInvalidProperty, "XHTTP Extra"));
|
v.Error(string.Format(ResUI.MsgInvalidProperty, ResUI.TransportExtra));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -159,7 +160,7 @@ public class NodeValidator
|
|||||||
{
|
{
|
||||||
if (JsonUtils.ParseJson(item.Finalmask) is not JsonObject)
|
if (JsonUtils.ParseJson(item.Finalmask) is not JsonObject)
|
||||||
{
|
{
|
||||||
v.Error(string.Format(ResUI.MsgInvalidProperty, "Finalmask"));
|
v.Error(string.Format(ResUI.MsgInvalidProperty, ResUI.TbFinalmask));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+9
-9
@@ -222,15 +222,6 @@ namespace ServiceLib.Resx {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 查找类似 Please fill in the correct IPv4 address for SendThrough. 的本地化字符串。
|
|
||||||
/// </summary>
|
|
||||||
public static string FillCorrectSendThroughIPv4 {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("FillCorrectSendThroughIPv4", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Please enter the correct port format. 的本地化字符串。
|
/// 查找类似 Please enter the correct port format. 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -2076,6 +2067,15 @@ namespace ServiceLib.Resx {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 Insecure configuration detected: AllowInsecure is enabled but no certificate is provided. This may cause MITM attacks. 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string MsgInsecureConfiguration {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("MsgInsecureConfiguration", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 The {0} property is invalid, please check 的本地化字符串。
|
/// 查找类似 The {0} property is invalid, please check 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -1710,9 +1710,6 @@ The "Get Certificate" action may fail if a self-signed certificate is used or if
|
|||||||
<data name="TbSettingsSendThroughTip" xml:space="preserve">
|
<data name="TbSettingsSendThroughTip" xml:space="preserve">
|
||||||
<value>For multi-interface environments, enter the local machine's IPv4 address</value>
|
<value>For multi-interface environments, enter the local machine's IPv4 address</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="FillCorrectSendThroughIPv4" xml:space="preserve">
|
|
||||||
<value>Please fill in the correct IPv4 address for SendThrough.</value>
|
|
||||||
</data>
|
|
||||||
<data name="TbSettingsBindInterface" xml:space="preserve">
|
<data name="TbSettingsBindInterface" xml:space="preserve">
|
||||||
<value>Bind Interface</value>
|
<value>Bind Interface</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -1701,9 +1701,6 @@ The "Get Certificate" action may fail if a self-signed certificate is used or if
|
|||||||
<data name="TbSettingsSendThroughTip" xml:space="preserve">
|
<data name="TbSettingsSendThroughTip" xml:space="preserve">
|
||||||
<value>Pour environnements multi-interfaces, entrez l'adresse IPv4 de la machine locale</value>
|
<value>Pour environnements multi-interfaces, entrez l'adresse IPv4 de la machine locale</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="FillCorrectSendThroughIPv4" xml:space="preserve">
|
|
||||||
<value>Veuillez saisir l’adresse IPv4 correcte de SendThrough.</value>
|
|
||||||
</data>
|
|
||||||
<data name="TbSettingsBindInterface" xml:space="preserve">
|
<data name="TbSettingsBindInterface" xml:space="preserve">
|
||||||
<value>Lier l'interface</value>
|
<value>Lier l'interface</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -1710,9 +1710,6 @@ The "Get Certificate" action may fail if a self-signed certificate is used or if
|
|||||||
<data name="TbSettingsSendThroughTip" xml:space="preserve">
|
<data name="TbSettingsSendThroughTip" xml:space="preserve">
|
||||||
<value>For multi-interface environments, enter the local machine's IPv4 address</value>
|
<value>For multi-interface environments, enter the local machine's IPv4 address</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="FillCorrectSendThroughIPv4" xml:space="preserve">
|
|
||||||
<value>Please fill in the correct IPv4 address for SendThrough.</value>
|
|
||||||
</data>
|
|
||||||
<data name="TbSettingsBindInterface" xml:space="preserve">
|
<data name="TbSettingsBindInterface" xml:space="preserve">
|
||||||
<value>Bind Interface</value>
|
<value>Bind Interface</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -1701,12 +1701,6 @@ Tindakan "Ambil sertifikat" mungkin gagal jika sertifikat self-signed digunakan
|
|||||||
<data name="TransportExtra" xml:space="preserve">
|
<data name="TransportExtra" xml:space="preserve">
|
||||||
<value>XHTTP Extra</value>
|
<value>XHTTP Extra</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbAllowInsecureCertFetch" xml:space="preserve">
|
|
||||||
<value>Izinkan pengambilan sertifikat tidak aman (self-signed)</value>
|
|
||||||
</data>
|
|
||||||
<data name="TbAllowInsecureCertFetchTips" xml:space="preserve">
|
|
||||||
<value>Hanya untuk mengambil sertifikat self-signed. Fitur ini dapat mengekspos Anda pada risiko MITM.</value>
|
|
||||||
</data>
|
|
||||||
<data name="menuUdpTestServer" xml:space="preserve">
|
<data name="menuUdpTestServer" xml:space="preserve">
|
||||||
<value>Uji latensi UDP konfigurasi</value>
|
<value>Uji latensi UDP konfigurasi</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -1719,9 +1713,6 @@ Tindakan "Ambil sertifikat" mungkin gagal jika sertifikat self-signed digunakan
|
|||||||
<data name="TbSettingsSendThroughTip" xml:space="preserve">
|
<data name="TbSettingsSendThroughTip" xml:space="preserve">
|
||||||
<value>Untuk lingkungan multi-antarmuka, masukkan alamat IPv4 mesin lokal.</value>
|
<value>Untuk lingkungan multi-antarmuka, masukkan alamat IPv4 mesin lokal.</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="FillCorrectSendThroughIPv4" xml:space="preserve">
|
|
||||||
<value>Isi alamat IPv4 yang benar untuk SendThrough.</value>
|
|
||||||
</data>
|
|
||||||
<data name="TbSettingsBindInterface" xml:space="preserve">
|
<data name="TbSettingsBindInterface" xml:space="preserve">
|
||||||
<value>Bind Interface</value>
|
<value>Bind Interface</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -1713,9 +1713,6 @@ The "Get Certificate" action may fail if a self-signed certificate is used or if
|
|||||||
<data name="TbSettingsSendThroughTip" xml:space="preserve">
|
<data name="TbSettingsSendThroughTip" xml:space="preserve">
|
||||||
<value>For multi-interface environments, enter the local machine's IPv4 address</value>
|
<value>For multi-interface environments, enter the local machine's IPv4 address</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="FillCorrectSendThroughIPv4" xml:space="preserve">
|
|
||||||
<value>Please fill in the correct IPv4 address for SendThrough.</value>
|
|
||||||
</data>
|
|
||||||
<data name="TbSettingsBindInterface" xml:space="preserve">
|
<data name="TbSettingsBindInterface" xml:space="preserve">
|
||||||
<value>Bind Interface</value>
|
<value>Bind Interface</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -1779,4 +1776,7 @@ The "Get Certificate" action may fail if a self-signed certificate is used or if
|
|||||||
<data name="TbSaveNetBridgeRule" xml:space="preserve">
|
<data name="TbSaveNetBridgeRule" xml:space="preserve">
|
||||||
<value>Save rules</value>
|
<value>Save rules</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="MsgInsecureConfiguration" xml:space="preserve">
|
||||||
|
<value>Insecure configuration detected: AllowInsecure is enabled but no certificate is provided. This may cause MITM attacks.</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -1710,9 +1710,6 @@
|
|||||||
<data name="TbSettingsSendThroughTip" xml:space="preserve">
|
<data name="TbSettingsSendThroughTip" xml:space="preserve">
|
||||||
<value>Для среды с несколькими сетевыми интерфейсами укажите IPv4-адрес локального компьютера</value>
|
<value>Для среды с несколькими сетевыми интерфейсами укажите IPv4-адрес локального компьютера</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="FillCorrectSendThroughIPv4" xml:space="preserve">
|
|
||||||
<value>Укажите корректный IPv4-адрес для SendThrough.</value>
|
|
||||||
</data>
|
|
||||||
<data name="TbSettingsBindInterface" xml:space="preserve">
|
<data name="TbSettingsBindInterface" xml:space="preserve">
|
||||||
<value>Привязать интерфейс</value>
|
<value>Привязать интерфейс</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -1707,9 +1707,6 @@
|
|||||||
<data name="TbSettingsSendThroughTip" xml:space="preserve">
|
<data name="TbSettingsSendThroughTip" xml:space="preserve">
|
||||||
<value>用于多网口环境,请填写本机 IPv4 地址</value>
|
<value>用于多网口环境,请填写本机 IPv4 地址</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="FillCorrectSendThroughIPv4" xml:space="preserve">
|
|
||||||
<value>请填写正确的 SendThrough IPv4 地址。</value>
|
|
||||||
</data>
|
|
||||||
<data name="TbSettingsBindInterface" xml:space="preserve">
|
<data name="TbSettingsBindInterface" xml:space="preserve">
|
||||||
<value>绑定网口</value>
|
<value>绑定网口</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -1776,4 +1773,7 @@
|
|||||||
<data name="TbSaveNetBridgeRule" xml:space="preserve">
|
<data name="TbSaveNetBridgeRule" xml:space="preserve">
|
||||||
<value>保存规则</value>
|
<value>保存规则</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="MsgInsecureConfiguration" xml:space="preserve">
|
||||||
|
<value>检测到不安全配置:AllowInsecure 已启用,但未提供证书。这可能会导致中间人攻击。</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -1707,9 +1707,6 @@
|
|||||||
<data name="TbSettingsSendThroughTip" xml:space="preserve">
|
<data name="TbSettingsSendThroughTip" xml:space="preserve">
|
||||||
<value>適用於多網路介面環境,請填寫本機 IPv4 位址</value>
|
<value>適用於多網路介面環境,請填寫本機 IPv4 位址</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="FillCorrectSendThroughIPv4" xml:space="preserve">
|
|
||||||
<value>請填寫正確的 SendThrough IPv4 位址。</value>
|
|
||||||
</data>
|
|
||||||
<data name="TbSettingsBindInterface" xml:space="preserve">
|
<data name="TbSettingsBindInterface" xml:space="preserve">
|
||||||
<value>綁定網路介面</value>
|
<value>綁定網路介面</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -66,10 +66,6 @@ public partial class CoreConfigSingboxService
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!(context.IsTunEnabled || context.IsWindows))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
foreach (var outbound in _coreConfig.outbounds ?? [])
|
foreach (var outbound in _coreConfig.outbounds ?? [])
|
||||||
{
|
{
|
||||||
outbound.bind_interface = ShouldBindNet(outbound) ? bindInterface : null;
|
outbound.bind_interface = ShouldBindNet(outbound) ? bindInterface : null;
|
||||||
@@ -83,10 +79,6 @@ public partial class CoreConfigSingboxService
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!Utils.IsLocalIP(sendThrough))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (var outbound in _coreConfig.outbounds ?? [])
|
foreach (var outbound in _coreConfig.outbounds ?? [])
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -138,10 +138,6 @@ public partial class CoreConfigV2rayService
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!(context.IsTunEnabled || context.IsWindows))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
foreach (var outbound in _coreConfig.outbounds ?? [])
|
foreach (var outbound in _coreConfig.outbounds ?? [])
|
||||||
{
|
{
|
||||||
if (!ShouldBindNet(outbound))
|
if (!ShouldBindNet(outbound))
|
||||||
@@ -176,10 +172,6 @@ public partial class CoreConfigV2rayService
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!Utils.IsLocalIP(sendThrough))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (var outbound in _coreConfig.outbounds ?? [])
|
foreach (var outbound in _coreConfig.outbounds ?? [])
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -300,12 +300,6 @@ public class OptionSettingViewModel : MyReactiveObject
|
|||||||
NoticeManager.Instance.Enqueue(ResUI.FillLocalListeningPort);
|
NoticeManager.Instance.Enqueue(ResUI.FillLocalListeningPort);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var sendThroughValue = SendThrough.TrimEx();
|
|
||||||
if (sendThroughValue.IsNotEmpty() && !Utils.IsIpv4(sendThroughValue))
|
|
||||||
{
|
|
||||||
NoticeManager.Instance.Enqueue(ResUI.FillCorrectSendThroughIPv4);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var needReboot = EnableStatistics != _config.GuiItem.EnableStatistics
|
var needReboot = EnableStatistics != _config.GuiItem.EnableStatistics
|
||||||
|| DisplayRealTimeSpeed != _config.GuiItem.DisplayRealTimeSpeed
|
|| DisplayRealTimeSpeed != _config.GuiItem.DisplayRealTimeSpeed
|
||||||
|| EnableDragDropSort != _config.UiItem.EnableDragDropSort
|
|| EnableDragDropSort != _config.UiItem.EnableDragDropSort
|
||||||
|
|||||||
Reference in New Issue
Block a user