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 <[email protected]>
This commit is contained in:
1 parent
7cfe061469
commit
e074bef702
1 file changed
+6
@@ -381,6 +381,12 @@ class Shadowrocket extends AbstractProtocol
|
||||
"obfs" => 'none',
|
||||
"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')) {
|
||||
$params['peer'] = $serverName;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user