mirror of
https://github.com/2dust/v2rayN.git
synced 2026-04-22 23:45:47 +00:00
Compare commits
4 commits
c1d2914e51
...
cf4ef4080b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cf4ef4080b | ||
|
|
588e82f0d9 | ||
|
|
0c13488410 | ||
|
|
a88396c11d |
6 changed files with 23 additions and 16 deletions
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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,
|
||||||
|
|
|
||||||
|
|
@ -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(),
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue