Compare commits

..

4 commits

Author SHA1 Message Date
DHR60
cf4ef4080b
Merge 0d06f1d63b into 588e82f0d9 2026-03-10 13:42:37 +08:00
DHR60
588e82f0d9
Tun ech protect (#8915)
Some checks are pending
release Linux / build (Release) (push) Waiting to run
release Linux / rpm (push) Blocked by required conditions
release macOS / build (Release) (push) Waiting to run
release Windows desktop (Avalonia UI) / build (Release) (push) Waiting to run
release Windows / build (Release) (push) Waiting to run
2026-03-10 09:16:16 +08:00
DHR60
0c13488410
Fix (#8914)
* Fix

* Fix
2026-03-10 09:14:57 +08:00
DHR60
a88396c11d
Fix custom config sub chain (#8913) 2026-03-10 09:13:52 +08:00
6 changed files with 23 additions and 16 deletions

View file

@ -227,7 +227,7 @@ public class CoreConfigContextBuilder
{ {
var result = NodeValidatorResult.Empty(); var result = NodeValidatorResult.Empty();
if (node.Subid.IsNullOrEmpty()) if (node.Subid.IsNullOrEmpty() || node.ConfigType == EConfigType.Custom)
{ {
return (null, result); return (null, result);
} }

View file

@ -724,8 +724,6 @@ public static class ConfigHandler
profileItem.SetProtocolExtra(profileItem.GetProtocolExtra() with profileItem.SetProtocolExtra(profileItem.GetProtocolExtra() with
{ {
SalamanderPass = profileItem.GetProtocolExtra().SalamanderPass?.TrimEx(), SalamanderPass = profileItem.GetProtocolExtra().SalamanderPass?.TrimEx(),
UpMbps = profileItem.GetProtocolExtra().UpMbps is null or < 0 ? config.HysteriaItem.UpMbps : profileItem.GetProtocolExtra().UpMbps,
DownMbps = profileItem.GetProtocolExtra().DownMbps is null or < 0 ? config.HysteriaItem.DownMbps : profileItem.GetProtocolExtra().DownMbps,
HopInterval = profileItem.GetProtocolExtra().HopInterval?.TrimEx(), HopInterval = profileItem.GetProtocolExtra().HopInterval?.TrimEx(),
}); });

View file

@ -362,6 +362,7 @@ public class TlsSettings4Ray
public bool? disableSystemRoot { get; set; } public bool? disableSystemRoot { get; set; }
public string? echConfigList { get; set; } public string? echConfigList { get; set; }
public string? echForceQuery { get; set; } public string? echForceQuery { get; set; }
public Sockopt4Ray? echSockopt { get; set; }
} }
public class CertificateSettings4Ray public class CertificateSettings4Ray

View file

@ -316,12 +316,20 @@ public partial class CoreConfigV2rayService(CoreConfigContext context)
SsMethod = Global.None, SsMethod = Global.None,
}); });
foreach (var outbound in _coreConfig.outbounds.Where(outbound => outbound.streamSettings?.sockopt?.dialerProxy?.IsNullOrEmpty() ?? true)) foreach (var outbound in _coreConfig.outbounds
.Where(o => o.streamSettings?.sockopt?.dialerProxy?.IsNullOrEmpty() ?? true))
{ {
outbound.streamSettings ??= new StreamSettings4Ray(); outbound.streamSettings ??= new();
outbound.streamSettings.sockopt ??= new Sockopt4Ray(); outbound.streamSettings.sockopt ??= new();
outbound.streamSettings.sockopt.dialerProxy = "tun-project-ss"; outbound.streamSettings.sockopt.dialerProxy = "tun-project-ss";
} }
// ech protected
foreach (var outbound in _coreConfig.outbounds
.Where(outbound => outbound.streamSettings?.tlsSettings?.echConfigList?.IsNullOrEmpty() == false))
{
outbound.streamSettings!.tlsSettings!.echSockopt ??= new();
outbound.streamSettings.tlsSettings.echSockopt.dialerProxy = "tun-project-ss";
}
_coreConfig.outbounds.Add(new CoreConfigV2rayService(context with _coreConfig.outbounds.Add(new CoreConfigV2rayService(context with
{ {
Node = protectNode, Node = protectNode,

View file

@ -27,10 +27,10 @@ public class AddServerViewModel : MyReactiveObject
public string Ports { get; set; } public string Ports { get; set; }
[Reactive] [Reactive]
public int UpMbps { get; set; } public int? UpMbps { get; set; }
[Reactive] [Reactive]
public int DownMbps { get; set; } public int? DownMbps { get; set; }
[Reactive] [Reactive]
public string HopInterval { get; set; } public string HopInterval { get; set; }
@ -122,8 +122,8 @@ public class AddServerViewModel : MyReactiveObject
AlterId = int.TryParse(protocolExtra?.AlterId, out var result) ? result : 0; AlterId = int.TryParse(protocolExtra?.AlterId, out var result) ? result : 0;
Flow = protocolExtra?.Flow ?? string.Empty; Flow = protocolExtra?.Flow ?? string.Empty;
SalamanderPass = protocolExtra?.SalamanderPass ?? string.Empty; SalamanderPass = protocolExtra?.SalamanderPass ?? string.Empty;
UpMbps = protocolExtra?.UpMbps ?? _config.HysteriaItem.UpMbps; UpMbps = protocolExtra?.UpMbps;
DownMbps = protocolExtra?.DownMbps ?? _config.HysteriaItem.DownMbps; DownMbps = protocolExtra?.DownMbps;
HopInterval = protocolExtra?.HopInterval.IsNullOrEmpty() ?? true ? Global.Hysteria2DefaultHopInt.ToString() : protocolExtra.HopInterval; HopInterval = protocolExtra?.HopInterval.IsNullOrEmpty() ?? true ? Global.Hysteria2DefaultHopInt.ToString() : protocolExtra.HopInterval;
VmessSecurity = protocolExtra?.VmessSecurity?.IsNullOrEmpty() == false ? protocolExtra.VmessSecurity : Global.DefaultSecurity; VmessSecurity = protocolExtra?.VmessSecurity?.IsNullOrEmpty() == false ? protocolExtra.VmessSecurity : Global.DefaultSecurity;
VlessEncryption = protocolExtra?.VlessEncryption.IsNullOrEmpty() == false ? protocolExtra.VlessEncryption : Global.None; VlessEncryption = protocolExtra?.VlessEncryption.IsNullOrEmpty() == false ? protocolExtra.VlessEncryption : Global.None;
@ -187,8 +187,8 @@ public class AddServerViewModel : MyReactiveObject
AlterId = AlterId > 0 ? AlterId.ToString() : null, AlterId = AlterId > 0 ? AlterId.ToString() : null,
Flow = Flow.NullIfEmpty(), Flow = Flow.NullIfEmpty(),
SalamanderPass = SalamanderPass.NullIfEmpty(), SalamanderPass = SalamanderPass.NullIfEmpty(),
UpMbps = UpMbps >= 0 ? UpMbps : null, UpMbps = UpMbps,
DownMbps = DownMbps >= 0 ? DownMbps : null, DownMbps = DownMbps,
HopInterval = HopInterval.NullIfEmpty(), HopInterval = HopInterval.NullIfEmpty(),
VmessSecurity = VmessSecurity.NullIfEmpty(), VmessSecurity = VmessSecurity.NullIfEmpty(),
VlessEncryption = VlessEncryption.NullIfEmpty(), VlessEncryption = VlessEncryption.NullIfEmpty(),

View file

@ -22,8 +22,8 @@ public class OptionSettingViewModel : MyReactiveObject
[Reactive] public string defUserAgent { get; set; } [Reactive] public string defUserAgent { get; set; }
[Reactive] public string mux4SboxProtocol { get; set; } [Reactive] public string mux4SboxProtocol { get; set; }
[Reactive] public bool enableCacheFile4Sbox { get; set; } [Reactive] public bool enableCacheFile4Sbox { get; set; }
[Reactive] public int hyUpMbps { get; set; } [Reactive] public int? hyUpMbps { get; set; }
[Reactive] public int hyDownMbps { get; set; } [Reactive] public int? hyDownMbps { get; set; }
[Reactive] public bool enableFragment { get; set; } [Reactive] public bool enableFragment { get; set; }
#endregion Core #endregion Core
@ -336,8 +336,8 @@ public class OptionSettingViewModel : MyReactiveObject
_config.CoreBasicItem.DefUserAgent = defUserAgent; _config.CoreBasicItem.DefUserAgent = defUserAgent;
_config.Mux4SboxItem.Protocol = mux4SboxProtocol; _config.Mux4SboxItem.Protocol = mux4SboxProtocol;
_config.CoreBasicItem.EnableCacheFile4Sbox = enableCacheFile4Sbox; _config.CoreBasicItem.EnableCacheFile4Sbox = enableCacheFile4Sbox;
_config.HysteriaItem.UpMbps = hyUpMbps; _config.HysteriaItem.UpMbps = hyUpMbps ?? 0;
_config.HysteriaItem.DownMbps = hyDownMbps; _config.HysteriaItem.DownMbps = hyDownMbps ?? 0;
_config.CoreBasicItem.EnableFragment = enableFragment; _config.CoreBasicItem.EnableFragment = enableFragment;
_config.GuiItem.AutoRun = AutoRun; _config.GuiItem.AutoRun = AutoRun;