Merge pull request #752 from Cp0204/features-subscription-optimization

update: Support TCP-HTTP sub rules
This commit is contained in:
tokumeikoi
2023-05-17 23:01:21 +08:00
committed by GitHub
9 changed files with 49 additions and 0 deletions

View File

@ -128,6 +128,11 @@ class Clash
$array['servername'] = $tlsSettings['serverName'];
}
}
if ($server['network'] === 'tcp') {
$tcpSettings = $server['networkSettings'];
if (isset($tcpSettings['header']['type'])) $array['network'] = $tcpSettings['header']['type'];
if (isset($tcpSettings['header']['request']['path'][0])) $array['http-opts']['path'] = $tcpSettings['header']['request']['path'][0];
}
if ($server['network'] === 'ws') {
$array['network'] = 'ws';
if ($server['networkSettings']) {