mirror of
https://github.com/2dust/v2rayN.git
synced 2026-02-28 21:23:04 +00:00
Fix
This commit is contained in:
parent
e2cd3069f0
commit
fe33c0e0e6
3 changed files with 54 additions and 52 deletions
|
|
@ -295,53 +295,56 @@ public sealed class AppManager
|
||||||
MultipleLoad = groupItem.MultipleLoad,
|
MultipleLoad = groupItem.MultipleLoad,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
switch (item.ConfigType)
|
switch (item.ConfigType)
|
||||||
{
|
{
|
||||||
case EConfigType.Shadowsocks:
|
case EConfigType.Shadowsocks:
|
||||||
extra = extra with {SsMethod = item.Security.NullIfEmpty() };
|
extra = extra with { SsMethod = item.Security.NullIfEmpty() };
|
||||||
break;
|
break;
|
||||||
case EConfigType.VMess:
|
case EConfigType.VMess:
|
||||||
extra = extra with
|
extra = extra with
|
||||||
{
|
{
|
||||||
AlterId = item.AlterId.ToString(),
|
AlterId = item.AlterId.ToString(),
|
||||||
VmessSecurity = item.Security.NullIfEmpty(),
|
VmessSecurity = item.Security.NullIfEmpty(),
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case EConfigType.VLESS:
|
case EConfigType.VLESS:
|
||||||
extra = extra with
|
extra = extra with
|
||||||
{
|
{
|
||||||
Flow = item.Flow.NullIfEmpty(),
|
Flow = item.Flow.NullIfEmpty(),
|
||||||
};
|
VlessEncryption = item.Security,
|
||||||
break;
|
};
|
||||||
case EConfigType.Hysteria2:
|
break;
|
||||||
extra = extra with
|
case EConfigType.Hysteria2:
|
||||||
{
|
extra = extra with
|
||||||
SalamanderPass = item.Path.NullIfEmpty(),
|
{
|
||||||
Ports = item.Ports.NullIfEmpty(),
|
SalamanderPass = item.Path.NullIfEmpty(),
|
||||||
UpMbps = _config.HysteriaItem.UpMbps,
|
Ports = item.Ports.NullIfEmpty(),
|
||||||
DownMbps = _config.HysteriaItem.DownMbps,
|
UpMbps = _config.HysteriaItem.UpMbps,
|
||||||
HopInterval = _config.HysteriaItem.HopInterval
|
DownMbps = _config.HysteriaItem.DownMbps,
|
||||||
};
|
HopInterval = _config.HysteriaItem.HopInterval
|
||||||
break;
|
};
|
||||||
case EConfigType.TUIC:
|
break;
|
||||||
extra = extra with
|
case EConfigType.TUIC:
|
||||||
{
|
extra = extra with
|
||||||
Username = item.Id,
|
{
|
||||||
};
|
Username = item.Id,
|
||||||
item.Id = item.Security;
|
};
|
||||||
item.Password = item.Security;
|
item.Id = item.Security;
|
||||||
break;
|
item.Password = item.Security;
|
||||||
case EConfigType.WireGuard:
|
break;
|
||||||
extra = extra with
|
case EConfigType.WireGuard:
|
||||||
{
|
extra = extra with
|
||||||
WgPublicKey = item.PublicKey.NullIfEmpty(),
|
{
|
||||||
WgInterfaceAddress = item.RequestHost.NullIfEmpty(),
|
WgPublicKey = item.PublicKey.NullIfEmpty(),
|
||||||
WgReserved = item.Path.NullIfEmpty(),
|
WgInterfaceAddress = item.RequestHost.NullIfEmpty(),
|
||||||
WgMtu = int.TryParse(item.ShortId, out var mtu) ? mtu : 1280
|
WgReserved = item.Path.NullIfEmpty(),
|
||||||
};
|
WgMtu = int.TryParse(item.ShortId, out var mtu) ? mtu : 1280
|
||||||
break;
|
};
|
||||||
}
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
item.SetProtocolExtra(extra);
|
item.SetProtocolExtra(extra);
|
||||||
|
|
|
||||||
|
|
@ -114,13 +114,13 @@ public partial class CoreConfigSingboxService
|
||||||
|
|
||||||
outbound.packet_encoding = "xudp";
|
outbound.packet_encoding = "xudp";
|
||||||
|
|
||||||
if (protocolExtra.Flow.IsNullOrEmpty())
|
if (!protocolExtra.Flow.IsNullOrEmpty())
|
||||||
{
|
{
|
||||||
await GenOutboundMux(node, outbound);
|
outbound.flow = protocolExtra.Flow;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
outbound.flow = protocolExtra.Flow;
|
await GenOutboundMux(node, outbound);
|
||||||
}
|
}
|
||||||
|
|
||||||
await GenOutboundTransport(node, outbound);
|
await GenOutboundTransport(node, outbound);
|
||||||
|
|
|
||||||
|
|
@ -144,13 +144,12 @@ public partial class CoreConfigV2rayService
|
||||||
usersItem.email = Global.UserEMail;
|
usersItem.email = Global.UserEMail;
|
||||||
usersItem.encryption = protocolExtra.VlessEncryption;
|
usersItem.encryption = protocolExtra.VlessEncryption;
|
||||||
|
|
||||||
if (protocolExtra.Flow.IsNullOrEmpty())
|
if (!protocolExtra.Flow.IsNullOrEmpty())
|
||||||
{
|
{
|
||||||
await GenOutboundMux(node, outbound, muxEnabled, muxEnabled);
|
usersItem.flow = protocolExtra.Flow;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
usersItem.flow = protocolExtra.Flow;
|
|
||||||
await GenOutboundMux(node, outbound, false, muxEnabled);
|
await GenOutboundMux(node, outbound, false, muxEnabled);
|
||||||
}
|
}
|
||||||
outbound.settings.servers = null;
|
outbound.settings.servers = null;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue