From b34cd8c78d4f6a31c4ad347199fe402aa48dd248 Mon Sep 17 00:00:00 2001 From: mercury Date: Tue, 14 Feb 2023 15:24:53 +0400 Subject: [PATCH] v2ray support for ss:// and qr --- app/bot.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/bot.php b/app/bot.php index caa0d7c..c684242 100644 --- a/app/bot.php +++ b/app/bot.php @@ -515,7 +515,7 @@ class Bot $scheme = empty($ssl = $this->nginxGetTypeCert()) ? 'http' : 'https'; $ss = $this->getSSConfig(); $port = !empty($ssl) && !empty($ss['plugin']) ? 443 : getenv('SSPORT'); - $ss_link = 'ss://' . base64_encode("{$ss['method']}:{$ss['password']}@$domain:$port"); + $ss_link = preg_replace('~==~', '', 'ss://' . base64_encode("{$ss['method']}:{$ss['password']}")) . "@$domain:$port" . (!empty($ss['plugin']) ? '?plugin=' . urlencode("v2ray-plugin;path=/v2ray;host=remindbot.ru;tls") : ''); $qr_file = __DIR__ . "/qr/shadowsocks.png"; exec("qrencode -t png -o $qr_file '$ss_link'"); $r = $this->sendPhoto( @@ -1579,13 +1579,13 @@ DNS-over-HTTPS with IP: 'callback_data' => "/sspswd", ], ]; - $ss_link = 'ss://' . base64_encode("{$ss['method']}:{$ss['password']}@$domain:$port"); + $ss_link = preg_replace('~==~', '', 'ss://' . base64_encode("{$ss['method']}:{$ss['password']}")) . "@$domain:$port" . (!empty($ss['plugin']) ? '?plugin=' . urlencode("v2ray-plugin;path=/v2ray;host=remindbot.ru;tls") : ''); $text .= "\n\n$ss_link\n"; $text .= "\n\nserver: $domain:$port"; $text .= "\n\nmethod: {$ss['method']}"; $text .= "\n\nnameserver: 10.10.0.5"; if ($ss['plugin']) { - $text .= "\n\nplugin: v2ray-plugin_windows_amd64"; + $text .= "\n\nplugin: v2ray-plugin"; $text .= "\n\nv2ray options: $options"; } $data[] = [