v2ray support for ss:// and qr

This commit is contained in:
mercury
2023-02-14 15:24:53 +04:00
parent 111e5ffb8d
commit b34cd8c78d
+3 -3
View File
@@ -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<code>$ss_link</code>\n";
$text .= "\n\nserver: <code>$domain:$port</code>";
$text .= "\n\nmethod: <code>{$ss['method']}</code>";
$text .= "\n\nnameserver: <code>10.10.0.5</code>";
if ($ss['plugin']) {
$text .= "\n\nplugin: <code>v2ray-plugin_windows_amd64</code>";
$text .= "\n\nplugin: <code>v2ray-plugin</code>";
$text .= "\n\nv2ray options: <code>$options</code>";
}
$data[] = [