fix(Shadowrocket.php): add missing bandwidth params for Hysteria2 (#1031)
* fix(Shadowrocket): add missing bandwidth params for Hysteria2 Fixes a critical issue where Hysteria 2 silently downgrades to non-Brutal congestion control (BBR/Reno) on Shadowrocket clients. * Refactor bandwidth parameters assignment Update bandwidth parameters to only include positive values. --------- Co-authored-by: Xboard <147830212+cedar2025@users.noreply.github.com>
This commit is contained in:
parent
7cfe061469
commit
e074bef702
@ -381,6 +381,12 @@ class Shadowrocket extends AbstractProtocol
|
|||||||
"obfs" => 'none',
|
"obfs" => 'none',
|
||||||
"fastopen" => 1
|
"fastopen" => 1
|
||||||
];
|
];
|
||||||
|
if (($upMbps = data_get($protocol_settings, 'bandwidth.up')) > 0) {
|
||||||
|
$params['upmbps'] = $upMbps;
|
||||||
|
}
|
||||||
|
if (($downMbps = data_get($protocol_settings, 'bandwidth.down')) > 0) {
|
||||||
|
$params['downmbps'] = $downMbps;
|
||||||
|
}
|
||||||
if ($serverName = data_get($protocol_settings, 'tls.server_name')) {
|
if ($serverName = data_get($protocol_settings, 'tls.server_name')) {
|
||||||
$params['peer'] = $serverName;
|
$params['peer'] = $serverName;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user