Merge pull request #13 from ClashUS/origin/master

一些 Stash 和 Loon 的字段下发问题修正
This commit is contained in:
wyx2685 2023-09-25 15:10:07 +08:00 committed by GitHub
commit 94d548ecbd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -89,8 +89,7 @@ class Loon
}
}
if ($server['tls']) {
if ($server['network'] === 'tcp')
array_push($config, 'over-tls=true');
array_push($config, 'over-tls=true');
if ($server['tlsSettings']) {
$tlsSettings = $server['tlsSettings'];
if (isset($tlsSettings['allowInsecure']) && !empty($tlsSettings['allowInsecure']))

View File

@ -169,7 +169,9 @@ class Stash
$array['server'] = $server['host'];
$array['port'] = $server['port'];
$array['uuid'] = $uuid;
$array['flow'] = !empty($server['flow']) ? $server['flow']: "";
$array['flow'] = (function($value){
return in_array($value, [null, 'none', 'xtls-rprx-origin','xtls-rprx-direct','xtls-rprx-splice'], true) ? $value : null;
})($server['flow'] ?? null);
$array['client-fingerprint'] = 'chrome';
$array['udp'] = true;