mirror of
https://github.com/lkddi/Xboard.git
synced 2026-04-24 20:17:32 +08:00
fix: Shadowrocket Trojan whitelist bug and xhttp support
This commit is contained in:
@@ -141,7 +141,7 @@ class Shadowrocket extends AbstractProtocol
|
|||||||
$config['obfsParam'] = $host;
|
$config['obfsParam'] = $host;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'h2':
|
case 'h2':
|
||||||
$config['obfs'] = "h2";
|
$config['obfs'] = "h2";
|
||||||
if ($path = data_get($protocol_settings, 'network_settings.path')) {
|
if ($path = data_get($protocol_settings, 'network_settings.path')) {
|
||||||
$config['path'] = $path;
|
$config['path'] = $path;
|
||||||
@@ -177,7 +177,6 @@ class Shadowrocket extends AbstractProtocol
|
|||||||
$config = [
|
$config = [
|
||||||
'tfo' => 1,
|
'tfo' => 1,
|
||||||
'remark' => $server['name'],
|
'remark' => $server['name'],
|
||||||
'alterId' => 0
|
|
||||||
];
|
];
|
||||||
|
|
||||||
// 判断是否开启xtls
|
// 判断是否开启xtls
|
||||||
|
|||||||
@@ -151,6 +151,10 @@ abstract class AbstractProtocol
|
|||||||
if (is_array($filterRule) && isset($filterRule['whitelist'])) {
|
if (is_array($filterRule) && isset($filterRule['whitelist'])) {
|
||||||
$allowedValues = $filterRule['whitelist'];
|
$allowedValues = $filterRule['whitelist'];
|
||||||
$strict = $filterRule['strict'] ?? false;
|
$strict = $filterRule['strict'] ?? false;
|
||||||
|
// Normalize flat array ['tcp', 'ws'] to ['tcp' => '0.0.0', 'ws' => '0.0.0']
|
||||||
|
if (!empty($allowedValues) && is_int(array_key_first($allowedValues))) {
|
||||||
|
$allowedValues = array_fill_keys($allowedValues, '0.0.0');
|
||||||
|
}
|
||||||
if ($strict) {
|
if ($strict) {
|
||||||
if ($actualValue === null) {
|
if ($actualValue === null) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user