update: Support TCP-HTTP sub rules

This commit is contained in:
Cp0204
2023-03-27 21:53:52 +08:00
parent d4ac203805
commit f9e79018d8
9 changed files with 49 additions and 0 deletions

View File

@ -82,6 +82,15 @@ class Shadowrocket
$config['peer'] = $tlsSettings['serverName'];
}
}
if ($server['network'] === 'tcp') {
if ($server['networkSettings']) {
$tcpSettings = $server['networkSettings'];
if (isset($tcpSettings['header']['type']) && !empty($tcpSettings['header']['type']))
$config['obfs'] = $tcpSettings['header']['type'];
if (isset($tcpSettings['header']['request']['path'][0]) && !empty($tcpSettings['header']['request']['path'][0]))
$config['path'] = $tcpSettings['header']['request']['path'][0];
}
}
if ($server['network'] === 'ws') {
$config['obfs'] = "websocket";
if ($server['networkSettings']) {