Compare commits

..

1 commit

Author SHA1 Message Date
DHR60
c1d2914e51
Merge 0d06f1d63b into ef5fee9975 2026-03-08 22:52:02 +03:00
6 changed files with 16 additions and 23 deletions

View file

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

View file

@ -724,6 +724,8 @@ 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,7 +362,6 @@ 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,20 +316,12 @@ public partial class CoreConfigV2rayService(CoreConfigContext context)
SsMethod = Global.None, SsMethod = Global.None,
}); });
foreach (var outbound in _coreConfig.outbounds foreach (var outbound in _coreConfig.outbounds.Where(outbound => outbound.streamSettings?.sockopt?.dialerProxy?.IsNullOrEmpty() ?? true))
.Where(o => o.streamSettings?.sockopt?.dialerProxy?.IsNullOrEmpty() ?? true))
{ {
outbound.streamSettings ??= new(); outbound.streamSettings ??= new StreamSettings4Ray();
outbound.streamSettings.sockopt ??= new(); outbound.streamSettings.sockopt ??= new Sockopt4Ray();
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; UpMbps = protocolExtra?.UpMbps ?? _config.HysteriaItem.UpMbps;
DownMbps = protocolExtra?.DownMbps; DownMbps = protocolExtra?.DownMbps ?? _config.HysteriaItem.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, UpMbps = UpMbps >= 0 ? UpMbps : null,
DownMbps = DownMbps, DownMbps = DownMbps >= 0 ? DownMbps : null,
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 ?? 0; _config.HysteriaItem.UpMbps = hyUpMbps;
_config.HysteriaItem.DownMbps = hyDownMbps ?? 0; _config.HysteriaItem.DownMbps = hyDownMbps;
_config.CoreBasicItem.EnableFragment = enableFragment; _config.CoreBasicItem.EnableFragment = enableFragment;
_config.GuiItem.AutoRun = AutoRun; _config.GuiItem.AutoRun = AutoRun;