mirror of
https://github.com/2dust/v2rayN.git
synced 2026-11-05 12:04:59 +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:
@@ -190,15 +190,16 @@ public partial class CoreConfigSingboxService
|
||||
|
||||
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;
|
||||
}
|
||||
else
|
||||
{
|
||||
FillOutboundMux(outbound);
|
||||
}
|
||||
|
||||
FillOutboundMux(outbound);
|
||||
FillOutboundTransport(outbound);
|
||||
break;
|
||||
}
|
||||
@@ -342,7 +343,7 @@ public partial class CoreConfigSingboxService
|
||||
{
|
||||
try
|
||||
{
|
||||
var muxEnabled = _node.MuxEnabled ?? _config.CoreBasicItem.MuxEnabled;
|
||||
var muxEnabled = _node.MuxEnabled ?? false;
|
||||
if (muxEnabled && _config.Mux4SboxItem.Protocol.IsNotEmpty())
|
||||
{
|
||||
var mux = new Multiplex4Sbox()
|
||||
@@ -396,7 +397,7 @@ public partial class CoreConfigSingboxService
|
||||
enabled = true,
|
||||
record_fragment = _config.CoreBasicItem.EnableFragment ? true : null,
|
||||
server_name = serverName,
|
||||
insecure = Utils.ToBool(_node.AllowInsecure.IsNullOrEmpty() ? _config.CoreBasicItem.DefAllowInsecure.ToString().ToLower() : _node.AllowInsecure),
|
||||
insecure = _node.GetAllowInsecure(),
|
||||
alpn = _node.GetAlpn(),
|
||||
};
|
||||
if (_node.Fingerprint.IsNotEmpty())
|
||||
|
||||
@@ -62,7 +62,7 @@ public partial class CoreConfigV2rayService
|
||||
try
|
||||
{
|
||||
var protocolExtra = _node.GetProtocolExtra();
|
||||
var muxEnabled = _node.MuxEnabled ?? _config.CoreBasicItem.MuxEnabled;
|
||||
var muxEnabled = _node.MuxEnabled ?? false;
|
||||
switch (_node.ConfigType)
|
||||
{
|
||||
case EConfigType.VMess:
|
||||
@@ -380,7 +380,7 @@ public partial class CoreConfigV2rayService
|
||||
|
||||
TlsSettings4Ray tlsSettings = new()
|
||||
{
|
||||
allowInsecure = Utils.ToBool(_node.AllowInsecure.IsNullOrEmpty() ? _config.CoreBasicItem.DefAllowInsecure.ToString().ToLower() : _node.AllowInsecure),
|
||||
allowInsecure = _node.GetAllowInsecure(),
|
||||
alpn = _node.GetAlpn(),
|
||||
fingerprint = _node.Fingerprint.IsNullOrEmpty() ? _config.CoreBasicItem.DefFingerprint : _node.Fingerprint,
|
||||
echConfigList = _node.EchConfigList.NullIfEmpty(),
|
||||
|
||||
Reference in New Issue
Block a user