From e7cc7b66e2aeba0fb70c850f8c9023461c611ce5 Mon Sep 17 00:00:00 2001 From: mercury Date: Fri, 4 Jul 2025 18:33:04 +0400 Subject: [PATCH] add configs to subs page --- app/bot.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/app/bot.php b/app/bot.php index 28baa7e..9cc9ffb 100644 --- a/app/bot.php +++ b/app/bot.php @@ -6484,10 +6484,19 @@ DNS-over-HTTPS with IP: ])); $vless = $this->linkXray($k); $windows = "$scheme://{$domain}/pac$hash?t=si&r=w&s=$uid"; + $_GET['s'] = $uid; + foreach ([ + 'xray' => 's', + 'singbox' => 'si', + 'clash' => 'cl' + ] as $k => $v) { + $_GET['t'] = $v; + $configs[$k] = $this->subscription(1); + } require __DIR__ . '/subscription.php'; } - public function subscription() + public function subscription($return = false) { switch ($_GET['t']) { case 's': @@ -6741,6 +6750,12 @@ DNS-over-HTTPS with IP: } break; } + if (!empty($return)) { + if ($_GET['t'] == 'cl') { + return yaml_emit($c); + } + return json_encode($c); + } if ($_GET['t'] == 'cl') { header('Content-type: text/yaml');