add anytls support

This commit is contained in:
Fearless
2025-05-19 09:25:52 +08:00
parent f839e8b3f0
commit 711151c7d6
8 changed files with 148 additions and 3 deletions
+22
View File
@@ -80,6 +80,10 @@ class ClashMeta implements ProtocolInterface
array_push($proxy, self::buildTuic($user['uuid'], $item));
array_push($proxies, $item['name']);
}
if ($item['type'] === 'anytls'){
array_push($proxy, self::buildAnyTLS($user['uuid'], $item));
array_push($proxies, $item['name']);
}
if ($item['type'] === 'socks') {
array_push($proxy, self::buildSocks5($user['uuid'], $item));
array_push($proxies, $item['name']);
@@ -391,6 +395,24 @@ class ClashMeta implements ProtocolInterface
return $array;
}
public static function buildAnyTLS($password, $server)
{
$protocol_settings = data_get($server, 'protocol_settings', []);
$array = [
'name' => $server['name'],
'type' => 'anytls',
'server' => $server['host'],
'port' => $server['port'],
'password' => $password,
'udp' => true,
];
$array['skip-cert-verify'] = (bool) data_get($protocol_settings, 'tls.allow_insecure', false);
return $array;
}
public static function buildMieru($password, $server)
{
$protocol_settings = data_get($server, 'protocol_settings', []);