mirror of
https://github.com/lkddi/Xboard.git
synced 2026-04-28 06:47:24 +08:00
feat(shadowrocket): support VLESS transports httpupgrade/xhttp/kcp
- Add parsing for httpupgrade, xhttp, and kcp in Shadowrocket VLESS builder - Ensure correct obfs/path/host/mode mapping for Shadowrocket compatibility
This commit is contained in:
@@ -199,6 +199,34 @@ class Shadowrocket extends AbstractProtocol
|
|||||||
$config['path'] = data_get($protocol_settings, 'network_settings.serviceName');
|
$config['path'] = data_get($protocol_settings, 'network_settings.serviceName');
|
||||||
$config['host'] = data_get($protocol_settings, 'tls_settings.server_name') ?? $server['host'];
|
$config['host'] = data_get($protocol_settings, 'tls_settings.server_name') ?? $server['host'];
|
||||||
break;
|
break;
|
||||||
|
case 'kcp':
|
||||||
|
$config['obfs'] = "kcp";
|
||||||
|
if ($seed = data_get($protocol_settings, 'network_settings.seed')) {
|
||||||
|
$config['path'] = $seed;
|
||||||
|
}
|
||||||
|
$config['type'] = data_get($protocol_settings, 'network_settings.header.type', 'none');
|
||||||
|
break;
|
||||||
|
case 'httpupgrade':
|
||||||
|
$config['obfs'] = "httpupgrade";
|
||||||
|
if ($path = data_get($protocol_settings, 'network_settings.path')) {
|
||||||
|
$config['path'] = $path;
|
||||||
|
}
|
||||||
|
if ($host = data_get($protocol_settings, 'network_settings.host', $server['host'])) {
|
||||||
|
$config['obfsParam'] = $host;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'xhttp':
|
||||||
|
$config['obfs'] = "xhttp";
|
||||||
|
if ($path = data_get($protocol_settings, 'network_settings.path')) {
|
||||||
|
$config['path'] = $path;
|
||||||
|
}
|
||||||
|
if ($host = data_get($protocol_settings, 'network_settings.host', $server['host'])) {
|
||||||
|
$config['obfsParam'] = $host;
|
||||||
|
}
|
||||||
|
if ($mode = data_get($protocol_settings, 'network_settings.mode', 'auto')) {
|
||||||
|
$config['mode'] = $mode;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$query = http_build_query($config, '', '&', PHP_QUERY_RFC3986);
|
$query = http_build_query($config, '', '&', PHP_QUERY_RFC3986);
|
||||||
|
|||||||
Reference in New Issue
Block a user