diff --git a/v2rayN/ServiceLib/Services/CoreConfig/Singbox/SingboxOutboundService.cs b/v2rayN/ServiceLib/Services/CoreConfig/Singbox/SingboxOutboundService.cs index b30c9c48..e08fe863 100644 --- a/v2rayN/ServiceLib/Services/CoreConfig/Singbox/SingboxOutboundService.cs +++ b/v2rayN/ServiceLib/Services/CoreConfig/Singbox/SingboxOutboundService.cs @@ -223,13 +223,14 @@ public partial class CoreConfigSingboxService password = protocolExtra.SalamanderPass.TrimEx(), }; } - - outbound.up_mbps = protocolExtra?.UpMbps is { } su and >= 0 + int? upMbps = protocolExtra?.UpMbps is { } su and >= 0 ? su : _config.HysteriaItem.UpMbps; - outbound.down_mbps = protocolExtra?.DownMbps is { } sd and >= 0 + int? downMbps = protocolExtra?.DownMbps is { } sd and >= 0 ? sd - : _config.HysteriaItem.DownMbps; + : _config.HysteriaItem.UpMbps; + outbound.up_mbps = upMbps > 0 ? upMbps : null; + outbound.down_mbps = downMbps > 0 ? downMbps : null; var ports = protocolExtra?.Ports?.IsNullOrEmpty() == false ? protocolExtra.Ports : null; if ((!ports.IsNullOrEmpty()) && (ports.Contains(':') || ports.Contains('-') || ports.Contains(','))) { diff --git a/v2rayN/ServiceLib/Services/CoreConfig/V2ray/V2rayOutboundService.cs b/v2rayN/ServiceLib/Services/CoreConfig/V2ray/V2rayOutboundService.cs index ca58623a..bc2dd366 100644 --- a/v2rayN/ServiceLib/Services/CoreConfig/V2ray/V2rayOutboundService.cs +++ b/v2rayN/ServiceLib/Services/CoreConfig/V2ray/V2rayOutboundService.cs @@ -675,7 +675,7 @@ public partial class CoreConfigV2rayService if (!_node.Finalmask.IsNullOrEmpty()) { - streamSettings.finalmask = JsonUtils.Deserialize(_node.Finalmask); + streamSettings.finalmask = JsonUtils.ParseJson(_node.Finalmask); } } catch (Exception ex)