Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix hy2 Brutal Bandwidth
  • Loading branch information
DHR60 committed Feb 5, 2026
commit 6d953669712d45ef6513ae01bb72eed5b3c090f8
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,10 @@ private async Task<int> GenOutbound(ProfileItem node, Outbound4Sbox outbound)

outbound.up_mbps = protocolExtra?.UpMbps is { } su and >= 0
? su
: 0;
: _config.HysteriaItem.UpMbps;
outbound.down_mbps = protocolExtra?.DownMbps is { } sd and >= 0
? sd
: 0;
: _config.HysteriaItem.DownMbps;
var ports = protocolExtra?.Ports?.IsNullOrEmpty() == false ? protocolExtra.Ports : null;
if ((!ports.IsNullOrEmpty()) && (ports.Contains(':') || ports.Contains('-') || ports.Contains(',')))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -515,10 +515,10 @@ private async Task<int> GenBoundStreamSettings(ProfileItem node, Outbounds4Ray o
var ports = protocolExtra?.Ports;
int? upMbps = protocolExtra?.UpMbps is { } su and >= 0
? su
: 0;
: _config.HysteriaItem.UpMbps;
int? downMbps = protocolExtra?.DownMbps is { } sd and >= 0
? sd
: 0;
: _config.HysteriaItem.UpMbps;
var hopInterval = protocolExtra?.HopInterval is { } hi and >= 5
? hi
: _config.HysteriaItem.HopInterval >= 5 ? _config.HysteriaItem.HopInterval : Global.Hysteria2DefaultHopInt;
Expand Down
8 changes: 4 additions & 4 deletions v2rayN/ServiceLib/ViewModels/AddServerViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ public AddServerViewModel(ProfileItem profileItem, Func<EViewAction, object?, Ta
AlterId = int.TryParse(protocolExtra?.AlterId, out var result) ? result : 0;
Flow = protocolExtra?.Flow ?? string.Empty;
SalamanderPass = protocolExtra?.SalamanderPass ?? string.Empty;
UpMbps = protocolExtra?.UpMbps ?? 0;
DownMbps = protocolExtra?.DownMbps ?? 0;
UpMbps = protocolExtra?.UpMbps ?? _config.HysteriaItem.UpMbps;
DownMbps = protocolExtra?.DownMbps ?? _config.HysteriaItem.DownMbps;
HopInterval = protocolExtra?.HopInterval ?? Global.Hysteria2DefaultHopInt;
VmessSecurity = protocolExtra?.VmessSecurity?.IsNullOrEmpty() == false ? protocolExtra.VmessSecurity : Global.DefaultSecurity;
VlessEncryption = protocolExtra?.VlessEncryption.IsNullOrEmpty() == false ? protocolExtra.VlessEncryption : Global.None;
Expand Down Expand Up @@ -176,8 +176,8 @@ private async Task SaveServerAsync()
AlterId = AlterId > 0 ? AlterId.ToString() : null,
Flow = Flow.NullIfEmpty(),
SalamanderPass = SalamanderPass.NullIfEmpty(),
UpMbps = UpMbps > 0 ? UpMbps : null,
DownMbps = DownMbps > 0 ? DownMbps : null,
UpMbps = UpMbps >= 0 ? UpMbps : null,
DownMbps = DownMbps >= 0 ? DownMbps : null,
HopInterval = HopInterval >= 5 ? HopInterval : null,
VmessSecurity = VmessSecurity.NullIfEmpty(),
VlessEncryption = VlessEncryption.NullIfEmpty(),
Expand Down