no message

This commit is contained in:
hellcat 2026-04-17 20:01:41 +08:00
parent a896f32795
commit 3c8c875d8c
4 changed files with 108 additions and 1 deletions

View File

@ -211,6 +211,10 @@ $_ENV['Clash_Config'] = [
'223.5.5.5',
'119.29.29.29',
],
'proxy-server-nameserver' => [
'223.5.5.5',
'119.29.29.29',
],
'enhanced-mode' => 'fake-ip',
'fake-ip-range' => '198.18.0.1/16',
'use-hosts' => true,
@ -278,7 +282,7 @@ $_ENV['Clash_Group_Config'] = [
'name' => '♻️ 自动节点',
'type' => 'url-test',
'hidden' => true,
'url' => 'http://cp.cloudflare.com/generate_204',
'url' => 'http://1.1.1.1/generate_204',
'interval' => 300,
// 插入节点名称
'proxies' => [

View File

@ -91,6 +91,35 @@ final class Clash extends Base
];
break;
case 101:
$v2_port = $node_custom_config['offset_port_user'] ??
($node_custom_config['offset_port_node'] ?? 443);
$network = $node_custom_config['network'] ?? 'tcp';
$udp = $node_custom_config['udp'] ?? true;
$tls = $node_custom_config['tls'] ?? true;
$browser = $node_custom_config['browser'] ?? 'chrome';
$servername = $node_custom_config['servername'] ?? '';
$flow = $node_custom_config['flow'] ?? '';
$node = [
'name' => $node_raw->name,
'type' => 'vless',
'server' => $node_raw->server,
'port' => (int) $v2_port,
'network' => $network,
'uuid' => $user->uuid,
'udp' => (bool) $udp,
'tls' => (bool) $tls,
'servername' => $servername,
'flow' => $flow,
'client-fingerprint' => $browser
];
if (isset($node_custom_config['reality-opts'])) {
$node['reality-opts'] = $node_custom_config['reality-opts'];
}
break;
case 11:
$v2_port = $node_custom_config['offset_port_user'] ??
($node_custom_config['offset_port_node'] ?? 443);

View File

@ -82,6 +82,49 @@ final class SingBox extends Base
$node['tls'] = array_filter($node['tls']);
break;
case 101:
$v2_port = $node_custom_config['offset_port_user'] ??
($node_custom_config['offset_port_node'] ?? 443);
// $transport = ($node_custom_config['network'] ?? '') === 'tcp' ? '' : $node_custom_config['network'];
$servername = $node_custom_config['servername'] ?? '';
$flow = $node_custom_config['flow'] ?? '';
$tls = $node_custom_config['tls'] ?? '';
$udp = $node_custom_config['udp'] ?? '';
$browser = $node_custom_config['browser'] ?? 'chrome';
$node = [
'type' => 'vless',
'tag' => $node_raw->name,
'server' => $node_raw->server,
'server_port' => (int) $v2_port,
'uuid' => $user->uuid,
'flow' => $flow,
];
if ($tls) {
$tls_a = [
'enabled' => true,
'server_name' => $servername
];
if ($udp) {
$tls_a["utls"] = [
'enabled' => true,
'fingerprint' => $browser
];
}
$node["tls"] = $tls_a;
}
if (isset($node_custom_config['reality-opts'])) {
$node["tls"]['reality']['enabled'] = true;
$node["tls"]['reality']['public_key'] = $node_custom_config['reality-opts']['public-key'] ?? '';
$node["tls"]['reality']['short_id'] = $node_custom_config['reality-opts']['short-id'] ?? '';
}
break;
case 11:
$v2_port = $node_custom_config['offset_port_user'] ??

View File

@ -55,7 +55,38 @@ final class V2Ray extends Base
$port = (int) ($node_custom_config['offset_port_user'] ?? 0);
$links .= 'ss://' . base64_encode($user->method . ':' . $user->passwd . '@' . $node_raw->server . ':' . $port) . '#' . rawurlencode($node_raw->name) . PHP_EOL;
} else if ((int) $node_raw->sort === 101) {
$network = $node_custom_config['network'] ?? 'tcp';
$reality_opts = $node_custom_config['reality-opts'] ?? [];
$browser = $node_custom_config['browser'] ?? 'chrome';
$flow = $node_custom_config['flow'] ?? '';
$servername = $node_custom_config['servername'] ?? '';
$security = $node_custom_config['security'] ?? 'none';
$uuid = $user->uuid;
$server = $node_raw->server;
$port = $node_custom_config['offset_port_user'] ?? ($node_custom_config['offset_port_node'] ?? 443);
$name = $node_raw->name;
if ($reality_opts) {
$security = 'reality';
}
// 构建查询参数
$aParams = [
'type' => $network,
'security' => $security,
'fp' => $browser,
'sni' => $servername,
'flow' => $flow,
'sid' => $reality_opts['short-id'] ?? '',
'pbk' => $reality_opts['public-key'] ?? ''
];
$links .= 'vless://' . $uuid . '@' . $server . ':' . $port . '?' . http_build_query($aParams) . '#' . rawurlencode($name) . PHP_EOL;
}
}
$links = base64_encode($links);