mirror of
https://github.com/2dust/v2rayN.git
synced 2026-11-09 05:55:01 +03:00
Remove global AllowInsecure and MuxEnabled (#9473)
* Remove global AllowInsecure * Remove global MuxEnabled * Fix core config * Centralize AllowInsecure handling * Warn insecure configuration --------- Co-authored-by: 2dust <31833384+2dust@users.noreply.github.com>
This commit is contained in:
@@ -17,7 +17,7 @@ internal static class CoreConfigTestFactory
|
|||||||
{
|
{
|
||||||
return new Config
|
return new Config
|
||||||
{
|
{
|
||||||
CoreBasicItem = new CoreBasicItem { Loglevel = "warning", MuxEnabled = false },
|
CoreBasicItem = new CoreBasicItem { Loglevel = "warning" },
|
||||||
TunModeItem = new TunModeItem { EnableTun = false, IcmpRouting = "default" },
|
TunModeItem = new TunModeItem { EnableTun = false, IcmpRouting = "default" },
|
||||||
KcpItem = new KcpItem(),
|
KcpItem = new KcpItem(),
|
||||||
GrpcItem = new GrpcItem(),
|
GrpcItem = new GrpcItem(),
|
||||||
|
|||||||
@@ -90,6 +90,8 @@ public class Global
|
|||||||
public const string XrayLocalCert = "XRAY_LOCATION_CERT";
|
public const string XrayLocalCert = "XRAY_LOCATION_CERT";
|
||||||
public const int SpeedTestPageSize = 1000;
|
public const int SpeedTestPageSize = 1000;
|
||||||
public const string LinuxBash = "/bin/bash";
|
public const string LinuxBash = "/bin/bash";
|
||||||
|
public const string StringTrue = "true";
|
||||||
|
public const string StringFalse = "false";
|
||||||
|
|
||||||
public const string SingboxDirectDNSTag = "direct_dns";
|
public const string SingboxDirectDNSTag = "direct_dns";
|
||||||
public const string SingboxRemoteDNSTag = "remote_dns";
|
public const string SingboxRemoteDNSTag = "remote_dns";
|
||||||
@@ -421,13 +423,6 @@ public class Global
|
|||||||
"stream-one"
|
"stream-one"
|
||||||
];
|
];
|
||||||
|
|
||||||
public static readonly List<string> AllowInsecure =
|
|
||||||
[
|
|
||||||
"true",
|
|
||||||
"false",
|
|
||||||
""
|
|
||||||
];
|
|
||||||
|
|
||||||
public static readonly List<string> DomainStrategy =
|
public static readonly List<string> DomainStrategy =
|
||||||
[
|
[
|
||||||
"AsIs",
|
"AsIs",
|
||||||
|
|||||||
@@ -29,35 +29,6 @@ public class NodeValidator
|
|||||||
return v.ToResult();
|
return v.ToResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
private class ValidationContext
|
|
||||||
{
|
|
||||||
public List<string> Errors { get; } = [];
|
|
||||||
public List<string> Warnings { get; } = [];
|
|
||||||
|
|
||||||
public void Error(string message)
|
|
||||||
{
|
|
||||||
Errors.Add(message);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Warning(string message)
|
|
||||||
{
|
|
||||||
Warnings.Add(message);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Assert(bool condition, string errorMsg)
|
|
||||||
{
|
|
||||||
if (!condition)
|
|
||||||
{
|
|
||||||
Error(errorMsg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public NodeValidatorResult ToResult()
|
|
||||||
{
|
|
||||||
return new NodeValidatorResult(Errors, Warnings);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void ValidateNodeAndCoreSupport(ProfileItem item, ECoreType coreType, ValidationContext v)
|
private static void ValidateNodeAndCoreSupport(ProfileItem item, ECoreType coreType, ValidationContext v)
|
||||||
{
|
{
|
||||||
if (item.ConfigType is EConfigType.Custom)
|
if (item.ConfigType is EConfigType.Custom)
|
||||||
@@ -126,6 +97,21 @@ public class NodeValidator
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (coreType is ECoreType.Xray
|
||||||
|
&& (protocolExtra.Flow ?? string.Empty).StartsWith("xtls", StringComparison.OrdinalIgnoreCase)
|
||||||
|
&& item.MuxEnabled == true)
|
||||||
|
{
|
||||||
|
v.Warning(string.Format(ResUI.MsgOptionsConflict, "XTLS", "Mux.Cool"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item.GetNetwork() is nameof(ETransport.ws)
|
||||||
|
&& item.EchConfigList.IsNullOrEmpty()
|
||||||
|
&& item.GetAlpn()?.FirstOrDefault() == "h3")
|
||||||
|
{
|
||||||
|
v.Warning(
|
||||||
|
"WebSocket but ALPN is set to h3, the core may ignore the ALPN setting or cause unexpected issues.");
|
||||||
|
}
|
||||||
|
|
||||||
// TLS & Security
|
// TLS & Security
|
||||||
if (item.StreamSecurity == Global.StreamSecurity)
|
if (item.StreamSecurity == Global.StreamSecurity)
|
||||||
{
|
{
|
||||||
@@ -136,12 +122,23 @@ public class NodeValidator
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check for deprecated allowInsecure property when TLS is enabled
|
// Check for deprecated allowInsecure property when TLS is enabled
|
||||||
if (item.AllowInsecure == "true"
|
if (item.GetAllowInsecure()
|
||||||
&& item.Cert.IsNullOrEmpty()
|
&& item.Cert.IsNullOrEmpty()
|
||||||
&& item.CertSha.IsNullOrEmpty())
|
&& item.CertSha.IsNullOrEmpty())
|
||||||
{
|
{
|
||||||
v.Warning(ResUI.MsgAllowInsecureDeprecated);
|
v.Warning(ResUI.MsgAllowInsecureDeprecated);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((coreType == ECoreType.Xray
|
||||||
|
&& item.GetAllowInsecure()
|
||||||
|
&& item.Cert.IsNullOrEmpty()
|
||||||
|
&& item.CertSha.IsNullOrEmpty())
|
||||||
|
|| (coreType == ECoreType.sing_box
|
||||||
|
&& item.GetAllowInsecure()
|
||||||
|
&& item.Cert.IsNullOrEmpty()))
|
||||||
|
{
|
||||||
|
v.Warning("Insecure configuration detected: AllowInsecure is enabled but no certificate is provided. This may cause MITM attacks.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.StreamSecurity == Global.StreamSecurityReality)
|
if (item.StreamSecurity == Global.StreamSecurityReality)
|
||||||
@@ -191,4 +188,33 @@ public class NodeValidator
|
|||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class ValidationContext
|
||||||
|
{
|
||||||
|
public List<string> Errors { get; } = [];
|
||||||
|
public List<string> Warnings { get; } = [];
|
||||||
|
|
||||||
|
public void Error(string message)
|
||||||
|
{
|
||||||
|
Errors.Add(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Warning(string message)
|
||||||
|
{
|
||||||
|
Warnings.Add(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Assert(bool condition, string errorMsg)
|
||||||
|
{
|
||||||
|
if (!condition)
|
||||||
|
{
|
||||||
|
Error(errorMsg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public NodeValidatorResult ToResult()
|
||||||
|
{
|
||||||
|
return new NodeValidatorResult(Errors, Warnings);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ public static class ConfigHandler
|
|||||||
{
|
{
|
||||||
LogEnabled = false,
|
LogEnabled = false,
|
||||||
Loglevel = "warning",
|
Loglevel = "warning",
|
||||||
MuxEnabled = false,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (config.Inbound == null)
|
if (config.Inbound == null)
|
||||||
@@ -875,7 +874,7 @@ public static class ConfigHandler
|
|||||||
profileItem.Fingerprint = string.Empty;
|
profileItem.Fingerprint = string.Empty;
|
||||||
profileItem.Alpn = string.Empty;
|
profileItem.Alpn = string.Empty;
|
||||||
profileItem.Network = string.Empty;
|
profileItem.Network = string.Empty;
|
||||||
profileItem.AllowInsecure = "false";
|
profileItem.AllowInsecure = string.Empty;
|
||||||
if (profileItem.StreamSecurity.IsNullOrEmpty())
|
if (profileItem.StreamSecurity.IsNullOrEmpty())
|
||||||
{
|
{
|
||||||
profileItem.StreamSecurity = Global.StreamSecurity;
|
profileItem.StreamSecurity = Global.StreamSecurity;
|
||||||
@@ -1107,10 +1106,6 @@ public static class ConfigHandler
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (profileItem.AllowInsecure.IsNullOrEmpty())
|
|
||||||
{
|
|
||||||
profileItem.AllowInsecure = config.CoreBasicItem.DefAllowInsecure.ToString().ToLower();
|
|
||||||
}
|
|
||||||
if (profileItem.Fingerprint.IsNullOrEmpty() && profileItem.StreamSecurity == Global.StreamSecurityReality)
|
if (profileItem.Fingerprint.IsNullOrEmpty() && profileItem.StreamSecurity == Global.StreamSecurityReality)
|
||||||
{
|
{
|
||||||
profileItem.Fingerprint = config.CoreBasicItem.DefFingerprint;
|
profileItem.Fingerprint = config.CoreBasicItem.DefFingerprint;
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ public class BaseFmt
|
|||||||
|
|
||||||
private static int ToUriQueryAllowInsecure(ProfileItem item, ref Dictionary<string, string> dicQuery)
|
private static int ToUriQueryAllowInsecure(ProfileItem item, ref Dictionary<string, string> dicQuery)
|
||||||
{
|
{
|
||||||
if (item.AllowInsecure.Equals(Global.AllowInsecure.First()))
|
if (item.GetAllowInsecure())
|
||||||
{
|
{
|
||||||
// Add two for compatibility
|
// Add two for compatibility
|
||||||
dicQuery.Add("insecure", "1");
|
dicQuery.Add("insecure", "1");
|
||||||
@@ -254,11 +254,11 @@ public class BaseFmt
|
|||||||
|
|
||||||
if (_allowInsecureArray.Any(k => GetQueryDecoded(query, k) == "1"))
|
if (_allowInsecureArray.Any(k => GetQueryDecoded(query, k) == "1"))
|
||||||
{
|
{
|
||||||
item.AllowInsecure = Global.AllowInsecure.First();
|
item.AllowInsecure = Global.StringTrue;
|
||||||
}
|
}
|
||||||
else if (_allowInsecureArray.Any(k => GetQueryDecoded(query, k) == "0"))
|
else if (_allowInsecureArray.Any(k => GetQueryDecoded(query, k) == "0"))
|
||||||
{
|
{
|
||||||
item.AllowInsecure = Global.AllowInsecure.Skip(1).First();
|
item.AllowInsecure = Global.StringFalse;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ public class VmessFmt : BaseFmt
|
|||||||
sni = item.Sni,
|
sni = item.Sni,
|
||||||
alpn = item.Alpn,
|
alpn = item.Alpn,
|
||||||
fp = item.Fingerprint,
|
fp = item.Fingerprint,
|
||||||
insecure = item.AllowInsecure.Equals(Global.AllowInsecure.First()) ? "1" : "0"
|
insecure = item.GetAllowInsecure() ? "1" : "0"
|
||||||
};
|
};
|
||||||
|
|
||||||
var url = JsonUtils.Serialize(vmessQRCode);
|
var url = JsonUtils.Serialize(vmessQRCode);
|
||||||
@@ -140,7 +140,7 @@ public class VmessFmt : BaseFmt
|
|||||||
item.Sni = Utils.ToString(vmessQRCode.sni);
|
item.Sni = Utils.ToString(vmessQRCode.sni);
|
||||||
item.Alpn = Utils.ToString(vmessQRCode.alpn);
|
item.Alpn = Utils.ToString(vmessQRCode.alpn);
|
||||||
item.Fingerprint = Utils.ToString(vmessQRCode.fp);
|
item.Fingerprint = Utils.ToString(vmessQRCode.fp);
|
||||||
item.AllowInsecure = vmessQRCode.insecure == "1" ? Global.AllowInsecure.First() : string.Empty;
|
item.AllowInsecure = vmessQRCode.insecure == "1" ? Global.StringTrue : string.Empty;
|
||||||
|
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,10 +7,6 @@ public class CoreBasicItem
|
|||||||
|
|
||||||
public string Loglevel { get; set; }
|
public string Loglevel { get; set; }
|
||||||
|
|
||||||
public bool MuxEnabled { get; set; }
|
|
||||||
|
|
||||||
public bool DefAllowInsecure { get; set; }
|
|
||||||
|
|
||||||
public string DefFingerprint { get; set; }
|
public string DefFingerprint { get; set; }
|
||||||
|
|
||||||
public string DefUserAgent { get; set; }
|
public string DefUserAgent { get; set; }
|
||||||
|
|||||||
@@ -146,6 +146,11 @@ public class ProfileItem
|
|||||||
TransportExtra = JsonUtils.Serialize(transportExtra, false);
|
TransportExtra = JsonUtils.Serialize(transportExtra, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool GetAllowInsecure()
|
||||||
|
{
|
||||||
|
return AllowInsecure == Global.StringTrue;
|
||||||
|
}
|
||||||
|
|
||||||
#endregion function
|
#endregion function
|
||||||
|
|
||||||
[PrimaryKey]
|
[PrimaryKey]
|
||||||
|
|||||||
Generated
+9
@@ -2112,6 +2112,15 @@ namespace ServiceLib.Resx {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 Conflict between {0} and {1} 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string MsgOptionsConflict {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("MsgOptionsConflict", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Resolved {0} successfully 的本地化字符串。
|
/// 查找类似 Resolved {0} successfully 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -1761,4 +1761,7 @@ The "Get Certificate" action may fail if a self-signed certificate is used or if
|
|||||||
<data name="MsgTunRouteExcludeInvalidAddress" xml:space="preserve">
|
<data name="MsgTunRouteExcludeInvalidAddress" xml:space="preserve">
|
||||||
<value>Invalid address in TUN route exclude list: {0}</value>
|
<value>Invalid address in TUN route exclude list: {0}</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="MsgOptionsConflict" xml:space="preserve">
|
||||||
|
<value>Conflict between {0} and {1}</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -1758,4 +1758,7 @@
|
|||||||
<data name="MsgTunRouteExcludeInvalidAddress" xml:space="preserve">
|
<data name="MsgTunRouteExcludeInvalidAddress" xml:space="preserve">
|
||||||
<value>TUN 路由排除列表包含无效地址:{0}</value>
|
<value>TUN 路由排除列表包含无效地址:{0}</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="MsgOptionsConflict" xml:space="preserve">
|
||||||
|
<value>{0} 与 {1} 冲突</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -190,15 +190,16 @@ public partial class CoreConfigSingboxService
|
|||||||
|
|
||||||
outbound.packet_encoding = "xudp";
|
outbound.packet_encoding = "xudp";
|
||||||
|
|
||||||
if (!protocolExtra.Flow.IsNullOrEmpty())
|
if (protocolExtra.Flow is "xtls-rprx-vision" or "xtls-rprx-vision-udp443")
|
||||||
|
{
|
||||||
|
outbound.flow = "xtls-rprx-vision";
|
||||||
|
}
|
||||||
|
else if (!protocolExtra.Flow.IsNullOrEmpty())
|
||||||
{
|
{
|
||||||
outbound.flow = protocolExtra.Flow;
|
outbound.flow = protocolExtra.Flow;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
FillOutboundMux(outbound);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
FillOutboundMux(outbound);
|
||||||
FillOutboundTransport(outbound);
|
FillOutboundTransport(outbound);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -342,7 +343,7 @@ public partial class CoreConfigSingboxService
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var muxEnabled = _node.MuxEnabled ?? _config.CoreBasicItem.MuxEnabled;
|
var muxEnabled = _node.MuxEnabled ?? false;
|
||||||
if (muxEnabled && _config.Mux4SboxItem.Protocol.IsNotEmpty())
|
if (muxEnabled && _config.Mux4SboxItem.Protocol.IsNotEmpty())
|
||||||
{
|
{
|
||||||
var mux = new Multiplex4Sbox()
|
var mux = new Multiplex4Sbox()
|
||||||
@@ -396,7 +397,7 @@ public partial class CoreConfigSingboxService
|
|||||||
enabled = true,
|
enabled = true,
|
||||||
record_fragment = _config.CoreBasicItem.EnableFragment ? true : null,
|
record_fragment = _config.CoreBasicItem.EnableFragment ? true : null,
|
||||||
server_name = serverName,
|
server_name = serverName,
|
||||||
insecure = Utils.ToBool(_node.AllowInsecure.IsNullOrEmpty() ? _config.CoreBasicItem.DefAllowInsecure.ToString().ToLower() : _node.AllowInsecure),
|
insecure = _node.GetAllowInsecure(),
|
||||||
alpn = _node.GetAlpn(),
|
alpn = _node.GetAlpn(),
|
||||||
};
|
};
|
||||||
if (_node.Fingerprint.IsNotEmpty())
|
if (_node.Fingerprint.IsNotEmpty())
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ public partial class CoreConfigV2rayService
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
var protocolExtra = _node.GetProtocolExtra();
|
var protocolExtra = _node.GetProtocolExtra();
|
||||||
var muxEnabled = _node.MuxEnabled ?? _config.CoreBasicItem.MuxEnabled;
|
var muxEnabled = _node.MuxEnabled ?? false;
|
||||||
switch (_node.ConfigType)
|
switch (_node.ConfigType)
|
||||||
{
|
{
|
||||||
case EConfigType.VMess:
|
case EConfigType.VMess:
|
||||||
@@ -380,7 +380,7 @@ public partial class CoreConfigV2rayService
|
|||||||
|
|
||||||
TlsSettings4Ray tlsSettings = new()
|
TlsSettings4Ray tlsSettings = new()
|
||||||
{
|
{
|
||||||
allowInsecure = Utils.ToBool(_node.AllowInsecure.IsNullOrEmpty() ? _config.CoreBasicItem.DefAllowInsecure.ToString().ToLower() : _node.AllowInsecure),
|
allowInsecure = _node.GetAllowInsecure(),
|
||||||
alpn = _node.GetAlpn(),
|
alpn = _node.GetAlpn(),
|
||||||
fingerprint = _node.Fingerprint.IsNullOrEmpty() ? _config.CoreBasicItem.DefFingerprint : _node.Fingerprint,
|
fingerprint = _node.Fingerprint.IsNullOrEmpty() ? _config.CoreBasicItem.DefFingerprint : _node.Fingerprint,
|
||||||
echConfigList = _node.EchConfigList.NullIfEmpty(),
|
echConfigList = _node.EchConfigList.NullIfEmpty(),
|
||||||
|
|||||||
@@ -8,6 +8,12 @@ public class AddServerViewModel : MyReactiveObject
|
|||||||
[Reactive]
|
[Reactive]
|
||||||
public string? CoreType { get; set; }
|
public string? CoreType { get; set; }
|
||||||
|
|
||||||
|
[Reactive]
|
||||||
|
public bool AllowInsecure { get; set; }
|
||||||
|
|
||||||
|
[Reactive]
|
||||||
|
public bool MuxEnabled { get; set; }
|
||||||
|
|
||||||
[Reactive]
|
[Reactive]
|
||||||
public string Cert { get; set; }
|
public string Cert { get; set; }
|
||||||
|
|
||||||
@@ -273,8 +279,10 @@ public class AddServerViewModel : MyReactiveObject
|
|||||||
SelectedSource = JsonUtils.DeepCopy(profileItem);
|
SelectedSource = JsonUtils.DeepCopy(profileItem);
|
||||||
}
|
}
|
||||||
CoreType = SelectedSource?.CoreType?.ToString();
|
CoreType = SelectedSource?.CoreType?.ToString();
|
||||||
Cert = SelectedSource?.Cert?.ToString() ?? string.Empty;
|
AllowInsecure = SelectedSource?.GetAllowInsecure() == true;
|
||||||
CertSha = SelectedSource?.CertSha?.ToString() ?? string.Empty;
|
MuxEnabled = SelectedSource?.MuxEnabled == true;
|
||||||
|
Cert = SelectedSource?.Cert ?? string.Empty;
|
||||||
|
CertSha = SelectedSource?.CertSha ?? string.Empty;
|
||||||
|
|
||||||
var protocolExtra = SelectedSource?.GetProtocolExtra() ?? new();
|
var protocolExtra = SelectedSource?.GetProtocolExtra() ?? new();
|
||||||
var transport = SelectedSource?.GetTransportExtra() ?? new();
|
var transport = SelectedSource?.GetTransportExtra() ?? new();
|
||||||
@@ -352,7 +360,9 @@ public class AddServerViewModel : MyReactiveObject
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SelectedSource.CoreType = CoreType.IsNullOrEmpty() ? null : (ECoreType)Enum.Parse(typeof(ECoreType), CoreType);
|
SelectedSource.CoreType = CoreType.IsNullOrEmpty() ? null : Enum.Parse<ECoreType>(CoreType);
|
||||||
|
SelectedSource.AllowInsecure = AllowInsecure ? Global.StringTrue : Global.StringFalse;
|
||||||
|
SelectedSource.MuxEnabled = MuxEnabled;
|
||||||
SelectedSource.Cert = Cert.IsNullOrEmpty() ? string.Empty : Cert;
|
SelectedSource.Cert = Cert.IsNullOrEmpty() ? string.Empty : Cert;
|
||||||
SelectedSource.CertSha = CertSha.IsNullOrEmpty() ? string.Empty : CertSha;
|
SelectedSource.CertSha = CertSha.IsNullOrEmpty() ? string.Empty : CertSha;
|
||||||
if (!Global.Networks.Contains(SelectedSource.Network))
|
if (!Global.Networks.Contains(SelectedSource.Network))
|
||||||
|
|||||||
@@ -14,10 +14,8 @@ public class OptionSettingViewModel : MyReactiveObject
|
|||||||
[Reactive] public bool NewPort4LAN { get; set; }
|
[Reactive] public bool NewPort4LAN { get; set; }
|
||||||
[Reactive] public string User { get; set; }
|
[Reactive] public string User { get; set; }
|
||||||
[Reactive] public string Pass { get; set; }
|
[Reactive] public string Pass { get; set; }
|
||||||
[Reactive] public bool MuxEnabled { get; set; }
|
|
||||||
[Reactive] public bool LogEnabled { get; set; }
|
[Reactive] public bool LogEnabled { get; set; }
|
||||||
[Reactive] public string Loglevel { get; set; }
|
[Reactive] public string Loglevel { get; set; }
|
||||||
[Reactive] public bool DefAllowInsecure { get; set; }
|
|
||||||
[Reactive] public string DefFingerprint { get; set; }
|
[Reactive] public string DefFingerprint { get; set; }
|
||||||
[Reactive] public string DefUserAgent { get; set; }
|
[Reactive] public string DefUserAgent { get; set; }
|
||||||
[Reactive] public string SendThrough { get; set; }
|
[Reactive] public string SendThrough { get; set; }
|
||||||
@@ -152,10 +150,8 @@ public class OptionSettingViewModel : MyReactiveObject
|
|||||||
NewPort4LAN = inbound.NewPort4LAN;
|
NewPort4LAN = inbound.NewPort4LAN;
|
||||||
User = inbound.User;
|
User = inbound.User;
|
||||||
Pass = inbound.Pass;
|
Pass = inbound.Pass;
|
||||||
MuxEnabled = _config.CoreBasicItem.MuxEnabled;
|
|
||||||
LogEnabled = _config.CoreBasicItem.LogEnabled;
|
LogEnabled = _config.CoreBasicItem.LogEnabled;
|
||||||
Loglevel = _config.CoreBasicItem.Loglevel;
|
Loglevel = _config.CoreBasicItem.Loglevel;
|
||||||
DefAllowInsecure = _config.CoreBasicItem.DefAllowInsecure;
|
|
||||||
DefFingerprint = _config.CoreBasicItem.DefFingerprint;
|
DefFingerprint = _config.CoreBasicItem.DefFingerprint;
|
||||||
DefUserAgent = _config.CoreBasicItem.DefUserAgent;
|
DefUserAgent = _config.CoreBasicItem.DefUserAgent;
|
||||||
SendThrough = _config.CoreBasicItem.SendThrough ?? string.Empty;
|
SendThrough = _config.CoreBasicItem.SendThrough ?? string.Empty;
|
||||||
@@ -346,8 +342,6 @@ public class OptionSettingViewModel : MyReactiveObject
|
|||||||
}
|
}
|
||||||
_config.CoreBasicItem.LogEnabled = LogEnabled;
|
_config.CoreBasicItem.LogEnabled = LogEnabled;
|
||||||
_config.CoreBasicItem.Loglevel = Loglevel;
|
_config.CoreBasicItem.Loglevel = Loglevel;
|
||||||
_config.CoreBasicItem.MuxEnabled = MuxEnabled;
|
|
||||||
_config.CoreBasicItem.DefAllowInsecure = DefAllowInsecure;
|
|
||||||
_config.CoreBasicItem.DefFingerprint = DefFingerprint;
|
_config.CoreBasicItem.DefFingerprint = DefFingerprint;
|
||||||
_config.CoreBasicItem.DefUserAgent = DefUserAgent;
|
_config.CoreBasicItem.DefUserAgent = DefUserAgent;
|
||||||
_config.CoreBasicItem.SendThrough = SendThrough.TrimEx();
|
_config.CoreBasicItem.SendThrough = SendThrough.TrimEx();
|
||||||
|
|||||||
@@ -1108,12 +1108,12 @@
|
|||||||
Margin="{StaticResource Margin4}"
|
Margin="{StaticResource Margin4}"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Text="{x:Static resx:ResUI.TbAllowInsecure}" />
|
Text="{x:Static resx:ResUI.TbAllowInsecure}" />
|
||||||
<ComboBox
|
<ToggleSwitch
|
||||||
x:Name="cmbAllowInsecure"
|
x:Name="togAllowInsecure"
|
||||||
Grid.Row="4"
|
Grid.Row="4"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Width="200"
|
Margin="{StaticResource Margin4}"
|
||||||
Margin="{StaticResource Margin4}" />
|
HorizontalAlignment="Left" />
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="5"
|
Grid.Row="5"
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ public partial class AddServerWindow : WindowBase<AddServerViewModel>
|
|||||||
|
|
||||||
cmbFingerprint.ItemsSource = Global.Fingerprints;
|
cmbFingerprint.ItemsSource = Global.Fingerprints;
|
||||||
cmbFingerprint2.ItemsSource = Global.Fingerprints;
|
cmbFingerprint2.ItemsSource = Global.Fingerprints;
|
||||||
cmbAllowInsecure.ItemsSource = Global.AllowInsecure;
|
|
||||||
cmbAlpn.ItemsSource = Global.Alpns;
|
cmbAlpn.ItemsSource = Global.Alpns;
|
||||||
|
|
||||||
var lstStreamSecurity = new List<string> { string.Empty, Global.StreamSecurity };
|
var lstStreamSecurity = new List<string> { string.Empty, Global.StreamSecurity };
|
||||||
@@ -116,7 +115,7 @@ public partial class AddServerWindow : WindowBase<AddServerViewModel>
|
|||||||
gridFinalmask.IsVisible = false;
|
gridFinalmask.IsVisible = false;
|
||||||
cmbFingerprint.IsEnabled = false;
|
cmbFingerprint.IsEnabled = false;
|
||||||
cmbAlpn.IsEnabled = false;
|
cmbAlpn.IsEnabled = false;
|
||||||
cmbAllowInsecure.IsEnabled = false;
|
togAllowInsecure.IsEnabled = false;
|
||||||
|
|
||||||
cmbCongestionControl12.ItemsSource = Global.NaiveCongestionControls;
|
cmbCongestionControl12.ItemsSource = Global.NaiveCongestionControls;
|
||||||
break;
|
break;
|
||||||
@@ -138,14 +137,14 @@ public partial class AddServerWindow : WindowBase<AddServerViewModel>
|
|||||||
this.Bind(ViewModel, vm => vm.SelectedSource.Password, v => v.txtId.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.Password, v => v.txtId.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.AlterId, v => v.txtAlterId.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.AlterId, v => v.txtAlterId.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.VmessSecurity, v => v.cmbSecurity.SelectedValue).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.VmessSecurity, v => v.cmbSecurity.SelectedValue).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.MuxEnabled, v => v.togmuxEnabled.IsChecked).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.MuxEnabled, v => v.togmuxEnabled.IsChecked).DisposeWith(disposables);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EConfigType.Shadowsocks:
|
case EConfigType.Shadowsocks:
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.Password, v => v.txtId3.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.Password, v => v.txtId3.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SsMethod, v => v.cmbSecurity3.SelectedValue).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SsMethod, v => v.cmbSecurity3.SelectedValue).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.Uot, v => v.togUotEnabled3.IsChecked).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.Uot, v => v.togUotEnabled3.IsChecked).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.MuxEnabled, v => v.togmuxEnabled3.IsChecked).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.MuxEnabled, v => v.togmuxEnabled3.IsChecked).DisposeWith(disposables);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EConfigType.SOCKS:
|
case EConfigType.SOCKS:
|
||||||
@@ -158,13 +157,13 @@ public partial class AddServerWindow : WindowBase<AddServerViewModel>
|
|||||||
this.Bind(ViewModel, vm => vm.SelectedSource.Password, v => v.txtId5.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.Password, v => v.txtId5.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.Flow, v => v.cmbFlow5.SelectedValue).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.Flow, v => v.cmbFlow5.SelectedValue).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.VlessEncryption, v => v.txtSecurity5.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.VlessEncryption, v => v.txtSecurity5.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.MuxEnabled, v => v.togmuxEnabled5.IsChecked).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.MuxEnabled, v => v.togmuxEnabled5.IsChecked).DisposeWith(disposables);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EConfigType.Trojan:
|
case EConfigType.Trojan:
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.Password, v => v.txtId6.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.Password, v => v.txtId6.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.Flow, v => v.cmbFlow6.SelectedValue).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.Flow, v => v.cmbFlow6.SelectedValue).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.MuxEnabled, v => v.togmuxEnabled6.IsChecked).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.MuxEnabled, v => v.togmuxEnabled6.IsChecked).DisposeWith(disposables);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EConfigType.Hysteria2:
|
case EConfigType.Hysteria2:
|
||||||
@@ -231,7 +230,7 @@ public partial class AddServerWindow : WindowBase<AddServerViewModel>
|
|||||||
|
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.StreamSecurity, v => v.cmbStreamSecurity.SelectedValue).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.StreamSecurity, v => v.cmbStreamSecurity.SelectedValue).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.Sni, v => v.txtSNI.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.Sni, v => v.txtSNI.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.AllowInsecure, v => v.cmbAllowInsecure.SelectedValue).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.AllowInsecure, v => v.togAllowInsecure.IsChecked).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.Fingerprint, v => v.cmbFingerprint.SelectedValue).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.Fingerprint, v => v.cmbFingerprint.SelectedValue).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.Alpn, v => v.cmbAlpn.SelectedValue).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.Alpn, v => v.cmbAlpn.SelectedValue).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.CertSha, v => v.txtCertSha256Pinning.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.CertSha, v => v.txtCertSha256Pinning.Text).DisposeWith(disposables);
|
||||||
|
|||||||
@@ -180,19 +180,6 @@
|
|||||||
Width="200"
|
Width="200"
|
||||||
Margin="{StaticResource Margin4}" />
|
Margin="{StaticResource Margin4}" />
|
||||||
|
|
||||||
<TextBlock
|
|
||||||
Grid.Row="11"
|
|
||||||
Grid.Column="0"
|
|
||||||
Margin="{StaticResource Margin4}"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Text="{x:Static resx:ResUI.TbSettingsMuxEnabled}" />
|
|
||||||
<ToggleSwitch
|
|
||||||
x:Name="togmuxEnabled"
|
|
||||||
Grid.Row="11"
|
|
||||||
Grid.Column="1"
|
|
||||||
Margin="{StaticResource Margin4}"
|
|
||||||
HorizontalAlignment="Left" />
|
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="12"
|
Grid.Row="12"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
@@ -219,19 +206,6 @@
|
|||||||
Width="200"
|
Width="200"
|
||||||
Margin="{StaticResource Margin4}" />
|
Margin="{StaticResource Margin4}" />
|
||||||
|
|
||||||
<TextBlock
|
|
||||||
Grid.Row="14"
|
|
||||||
Grid.Column="0"
|
|
||||||
Margin="{StaticResource Margin4}"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Text="{x:Static resx:ResUI.TbSettingsDefAllowInsecure}" />
|
|
||||||
<ToggleSwitch
|
|
||||||
x:Name="togdefAllowInsecure"
|
|
||||||
Grid.Row="14"
|
|
||||||
Grid.Column="1"
|
|
||||||
Margin="{StaticResource Margin4}"
|
|
||||||
HorizontalAlignment="Left" />
|
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="15"
|
Grid.Row="15"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
|
|||||||
@@ -71,10 +71,8 @@ public partial class OptionSettingWindow : WindowBase<OptionSettingViewModel>
|
|||||||
this.Bind(ViewModel, vm => vm.NewPort4LAN, v => v.txtpass.IsEnabled).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.NewPort4LAN, v => v.txtpass.IsEnabled).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.User, v => v.txtuser.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.User, v => v.txtuser.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.Pass, v => v.txtpass.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.Pass, v => v.txtpass.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.MuxEnabled, v => v.togmuxEnabled.IsChecked).DisposeWith(disposables);
|
|
||||||
this.Bind(ViewModel, vm => vm.LogEnabled, v => v.toglogEnabled.IsChecked).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.LogEnabled, v => v.toglogEnabled.IsChecked).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.Loglevel, v => v.cmbloglevel.SelectedValue).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.Loglevel, v => v.cmbloglevel.SelectedValue).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.DefAllowInsecure, v => v.togdefAllowInsecure.IsChecked).DisposeWith(disposables);
|
|
||||||
this.Bind(ViewModel, vm => vm.DefFingerprint, v => v.cmbdefFingerprint.SelectedValue).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.DefFingerprint, v => v.cmbdefFingerprint.SelectedValue).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.DefUserAgent, v => v.cmbdefUserAgent.SelectedValue).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.DefUserAgent, v => v.cmbdefUserAgent.SelectedValue).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.BindInterface, v => v.txtbindInterface.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.BindInterface, v => v.txtbindInterface.Text).DisposeWith(disposables);
|
||||||
|
|||||||
@@ -1438,13 +1438,12 @@
|
|||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Style="{StaticResource ToolbarTextBlock}"
|
Style="{StaticResource ToolbarTextBlock}"
|
||||||
Text="{x:Static resx:ResUI.TbAllowInsecure}" />
|
Text="{x:Static resx:ResUI.TbAllowInsecure}" />
|
||||||
<ComboBox
|
<ToggleButton
|
||||||
x:Name="cmbAllowInsecure"
|
x:Name="togAllowInsecure"
|
||||||
Grid.Row="4"
|
Grid.Row="4"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Width="200"
|
|
||||||
Margin="{StaticResource Margin4}"
|
Margin="{StaticResource Margin4}"
|
||||||
Style="{StaticResource DefComboBox}" />
|
HorizontalAlignment="Left" />
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="5"
|
Grid.Row="5"
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ public partial class AddServerWindow
|
|||||||
|
|
||||||
cmbFingerprint.ItemsSource = Global.Fingerprints;
|
cmbFingerprint.ItemsSource = Global.Fingerprints;
|
||||||
cmbFingerprint2.ItemsSource = Global.Fingerprints;
|
cmbFingerprint2.ItemsSource = Global.Fingerprints;
|
||||||
cmbAllowInsecure.ItemsSource = Global.AllowInsecure;
|
|
||||||
cmbAlpn.ItemsSource = Global.Alpns;
|
cmbAlpn.ItemsSource = Global.Alpns;
|
||||||
|
|
||||||
var lstStreamSecurity = new List<string> { string.Empty, Global.StreamSecurity };
|
var lstStreamSecurity = new List<string> { string.Empty, Global.StreamSecurity };
|
||||||
@@ -115,7 +114,7 @@ public partial class AddServerWindow
|
|||||||
gridFinalmask.Visibility = Visibility.Collapsed;
|
gridFinalmask.Visibility = Visibility.Collapsed;
|
||||||
cmbFingerprint.IsEnabled = false;
|
cmbFingerprint.IsEnabled = false;
|
||||||
cmbAlpn.IsEnabled = false;
|
cmbAlpn.IsEnabled = false;
|
||||||
cmbAllowInsecure.IsEnabled = false;
|
togAllowInsecure.IsEnabled = false;
|
||||||
|
|
||||||
cmbCongestionControl12.ItemsSource = Global.NaiveCongestionControls;
|
cmbCongestionControl12.ItemsSource = Global.NaiveCongestionControls;
|
||||||
break;
|
break;
|
||||||
@@ -137,14 +136,14 @@ public partial class AddServerWindow
|
|||||||
this.Bind(ViewModel, vm => vm.SelectedSource.Password, v => v.txtId.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.Password, v => v.txtId.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.AlterId, v => v.txtAlterId.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.AlterId, v => v.txtAlterId.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.VmessSecurity, v => v.cmbSecurity.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.VmessSecurity, v => v.cmbSecurity.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.MuxEnabled, v => v.togmuxEnabled.IsChecked).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.MuxEnabled, v => v.togmuxEnabled.IsChecked).DisposeWith(disposables);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EConfigType.Shadowsocks:
|
case EConfigType.Shadowsocks:
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.Password, v => v.txtId3.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.Password, v => v.txtId3.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SsMethod, v => v.cmbSecurity3.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SsMethod, v => v.cmbSecurity3.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.Uot, v => v.togUotEnabled3.IsChecked).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.Uot, v => v.togUotEnabled3.IsChecked).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.MuxEnabled, v => v.togmuxEnabled3.IsChecked).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.MuxEnabled, v => v.togmuxEnabled3.IsChecked).DisposeWith(disposables);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EConfigType.SOCKS:
|
case EConfigType.SOCKS:
|
||||||
@@ -157,13 +156,13 @@ public partial class AddServerWindow
|
|||||||
this.Bind(ViewModel, vm => vm.SelectedSource.Password, v => v.txtId5.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.Password, v => v.txtId5.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.Flow, v => v.cmbFlow5.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.Flow, v => v.cmbFlow5.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.VlessEncryption, v => v.txtSecurity5.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.VlessEncryption, v => v.txtSecurity5.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.MuxEnabled, v => v.togmuxEnabled5.IsChecked).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.MuxEnabled, v => v.togmuxEnabled5.IsChecked).DisposeWith(disposables);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EConfigType.Trojan:
|
case EConfigType.Trojan:
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.Password, v => v.txtId6.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.Password, v => v.txtId6.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.Flow, v => v.cmbFlow6.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.Flow, v => v.cmbFlow6.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.MuxEnabled, v => v.togmuxEnabled6.IsChecked).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.MuxEnabled, v => v.togmuxEnabled6.IsChecked).DisposeWith(disposables);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EConfigType.Hysteria2:
|
case EConfigType.Hysteria2:
|
||||||
@@ -229,7 +228,7 @@ public partial class AddServerWindow
|
|||||||
|
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.StreamSecurity, v => v.cmbStreamSecurity.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.StreamSecurity, v => v.cmbStreamSecurity.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.Sni, v => v.txtSNI.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.Sni, v => v.txtSNI.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.AllowInsecure, v => v.cmbAllowInsecure.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.AllowInsecure, v => v.togAllowInsecure.IsChecked).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.Fingerprint, v => v.cmbFingerprint.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.Fingerprint, v => v.cmbFingerprint.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SelectedSource.Alpn, v => v.cmbAlpn.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedSource.Alpn, v => v.cmbAlpn.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.CertSha, v => v.txtCertSha256Pinning.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.CertSha, v => v.txtCertSha256Pinning.Text).DisposeWith(disposables);
|
||||||
|
|||||||
@@ -227,20 +227,6 @@
|
|||||||
Margin="{StaticResource Margin8}"
|
Margin="{StaticResource Margin8}"
|
||||||
Style="{StaticResource DefTextBox}" />
|
Style="{StaticResource DefTextBox}" />
|
||||||
|
|
||||||
<TextBlock
|
|
||||||
Grid.Row="11"
|
|
||||||
Grid.Column="0"
|
|
||||||
Margin="{StaticResource Margin8}"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Style="{StaticResource ToolbarTextBlock}"
|
|
||||||
Text="{x:Static resx:ResUI.TbSettingsMuxEnabled}" />
|
|
||||||
<ToggleButton
|
|
||||||
x:Name="togmuxEnabled"
|
|
||||||
Grid.Row="11"
|
|
||||||
Grid.Column="1"
|
|
||||||
Margin="{StaticResource Margin8}"
|
|
||||||
HorizontalAlignment="Left" />
|
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="12"
|
Grid.Row="12"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
@@ -271,20 +257,6 @@
|
|||||||
materialDesign:HintAssist.Hint="Level"
|
materialDesign:HintAssist.Hint="Level"
|
||||||
Style="{StaticResource DefComboBox}" />
|
Style="{StaticResource DefComboBox}" />
|
||||||
|
|
||||||
<TextBlock
|
|
||||||
Grid.Row="14"
|
|
||||||
Grid.Column="0"
|
|
||||||
Margin="{StaticResource Margin8}"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Style="{StaticResource ToolbarTextBlock}"
|
|
||||||
Text="{x:Static resx:ResUI.TbSettingsDefAllowInsecure}" />
|
|
||||||
<ToggleButton
|
|
||||||
x:Name="togdefAllowInsecure"
|
|
||||||
Grid.Row="14"
|
|
||||||
Grid.Column="1"
|
|
||||||
Margin="{StaticResource Margin8}"
|
|
||||||
HorizontalAlignment="Left" />
|
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="15"
|
Grid.Row="15"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
|
|||||||
@@ -68,10 +68,8 @@ public partial class OptionSettingWindow
|
|||||||
this.Bind(ViewModel, vm => vm.NewPort4LAN, v => v.txtpass.IsEnabled).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.NewPort4LAN, v => v.txtpass.IsEnabled).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.User, v => v.txtuser.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.User, v => v.txtuser.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.Pass, v => v.txtpass.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.Pass, v => v.txtpass.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.MuxEnabled, v => v.togmuxEnabled.IsChecked).DisposeWith(disposables);
|
|
||||||
this.Bind(ViewModel, vm => vm.LogEnabled, v => v.toglogEnabled.IsChecked).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.LogEnabled, v => v.toglogEnabled.IsChecked).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.Loglevel, v => v.cmbloglevel.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.Loglevel, v => v.cmbloglevel.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.DefAllowInsecure, v => v.togdefAllowInsecure.IsChecked).DisposeWith(disposables);
|
|
||||||
this.Bind(ViewModel, vm => vm.DefFingerprint, v => v.cmbdefFingerprint.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.DefFingerprint, v => v.cmbdefFingerprint.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.DefUserAgent, v => v.cmbdefUserAgent.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.DefUserAgent, v => v.cmbdefUserAgent.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SendThrough, v => v.txtsendThrough.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SendThrough, v => v.txtsendThrough.Text).DisposeWith(disposables);
|
||||||
|
|||||||
Reference in New Issue
Block a user