Compare commits

..

3 Commits

Author SHA1 Message Date
mercury 10d84da53e fix websocket -> reality 2024-09-08 00:58:37 +04:00
mercury c7cc0f31ad fix v2ray links 2024-09-03 19:23:38 +04:00
mercury e3ddb642d7 fix import, fix ws transport 2024-09-03 18:27:26 +04:00
2 changed files with 32 additions and 10 deletions
+25 -10
View File
@@ -1375,7 +1375,7 @@ class Bot
$t = file_get_contents('/config/nginx_default.conf');
if (!empty($json['pac']['domain'])) {
$t = preg_replace('/server_name ([^\n]+)?/', "server_name {$json['pac']['domain']};", $t);
$t = preg_replace('/server_name ([^\n]+)?/', "server_name *.{$json['pac']['domain']} {$json['pac']['domain']};", $t);
preg_match_all('~#-domain.+?#-domain~s', $t, $m);
foreach ($m[0] as $k => $v) {
$t = preg_replace('~#-domain.+?#-domain~s', $this->uncomment($v, 'domain'), $t, 1);
@@ -3771,14 +3771,22 @@ DNS-over-HTTPS with IP:
't' => 'si',
's' => $c['inbounds'][0]['settings']['clients'][$i]['id'],
]));
$v2 = "$scheme://{$domain}/pac/" . base64_encode(serialize([
'h' => $hash,
't' => 's',
's' => $c['inbounds'][0]['settings']['clients'][$i]['id'],
]));
switch ($s) {
case 1:
return "$scheme://{$domain}/pac?h=$hash&t=s&s={$c['inbounds'][0]['settings']['clients'][$i]['id']}";
return "v2rayng://install-config?url=$v2#{$c['inbounds'][0]['settings']['clients'][$i]['id']}";
case 2:
return "sing-box://import-remote-profile/?url={$si}#{$c['inbounds'][0]['settings']['clients'][$i]['email']}";
default:
if ($pac['transport'] == 'Websocket') {
return "vless://{$c['inbounds'][0]['settings']['clients'][$i]['id']}@$domain:443?flow=&path=%2Fws&security=tls&sni=$domain&fp=chrome&type=ws#{$c['inbounds'][0]['settings']['clients'][$i]['email']}";
}
return "vless://{$c['inbounds'][0]['settings']['clients'][$i]['id']}@$domain:443?security=reality&sni={$c['inbounds'][0]['streamSettings']['realitySettings']['serverNames'][0]}&fp=chrome&pbk={$pac['xray']}&sid={$c['inbounds'][0]['streamSettings']['realitySettings']['shortIds'][0]}&type=tcp&flow=xtls-rprx-vision#{$c['inbounds'][0]['settings']['clients'][$i]['email']}";
}
}
@@ -4207,7 +4215,9 @@ DNS-over-HTTPS with IP:
$c = $this->getXray();
$p = $this->getPacConf();
$text[] = "Menu -> " . $this->i18n('xray');
$text[] = "fake domain: <code>{$c['inbounds'][0]['streamSettings']['realitySettings']['serverNames'][0]}</code>";
if (!empty($fake = $c['inbounds'][0]['streamSettings']['realitySettings']['serverNames'][0])) {
$text[] = "fake domain: <code>$fake</code>";
}
$text[] = 'transport: ' . ($p['transport'] ?: 'Reality');
$data[] = [
[
@@ -4469,7 +4479,7 @@ DNS-over-HTTPS with IP:
$hash = substr(md5($this->key), 0, 8);
$text[] = "Menu -> " . $this->i18n('xray') . " -> {$c['email']}\n";
$text[] = "<code>{$this->linkXray($i)}</code>\n";
$text[] = "<pre><code>{$this->linkXray($i)}</code></pre>\n";
$text[] = "import subscribe:";
$text[] = "<a href='$scheme://{$domain}/pac?h=$hash&t=s&r=v&s={$c['id']}#{$c['email']}'>v2rayng</a>";
@@ -4477,8 +4487,8 @@ DNS-over-HTTPS with IP:
$text[] = "<a href='$scheme://{$domain}/pac?h=$hash&t=s&r=st&s={$c['id']}#{$c['email']}'>streisand</a>";
$text[] = "<a href='$scheme://{$domain}/pac?h=$hash&t=si&r=h&s={$c['id']}#{$c['email']}'>hiddify</a>";
$text[] = "\nv2ray config: <code>$scheme://{$domain}/pac?h=$hash&t=s&s={$c['id']}</code>";
$text[] = "sing-box config: <code>$scheme://{$domain}/pac?h=$hash&t=si&s={$c['id']}</code>";
$text[] = "\nv2ray config: <pre><code>$scheme://{$domain}/pac?h=$hash&t=s&s={$c['id']}</code></pre>";
$text[] = "sing-box config: <pre><code>$scheme://{$domain}/pac?h=$hash&t=si&s={$c['id']}</code></pre>";
$text[] = "sing-box windows: <a href='$scheme://{$domain}/pac?h=$hash&t=si&r=w&s={$c['id']}'>windows service</a>";
$data[] = [
@@ -4620,19 +4630,23 @@ DNS-over-HTTPS with IP:
't' => 'si',
's' => $uid,
]));
$v2 = "$scheme://{$domain}/pac?h=$hash&t=s&s=$uid";
$v2 = "$scheme://{$domain}/pac/" . base64_encode(serialize([
'h' => $hash,
't' => 's',
's' => $uid,
]));
switch ($_GET['r']) {
case 'si':
header("Location: sing-box://import-remote-profile/?url=" . $si);
header("Location: sing-box://import-remote-profile/?url=$si");
exit;
case 'st':
header("Location: streisand://import/$v2");
exit;
case 'v':
header("Location: v2rayng://install-config?url=" . urlencode($v2));
header("Location: v2rayng://install-config?url=$v2");
exit;
case 'h':
header("Location: hiddify://install-config/?url=" . $si);
header("Location: hiddify://install-config/?url=$si");
exit;
case 'w':
$link = htmlspecialchars($si, ENT_XML1, 'UTF-8');
@@ -5545,6 +5559,7 @@ DNS-over-HTTPS with IP:
"security" => "reality"
];
}
$this->setUpstreamDomain($ws ? 't' : $p['reality']['domain']);
$this->setPacConf($p);
$this->restartXray($x);
$this->xray();
+7
View File
@@ -1,3 +1,10 @@
08.09.2024 v1.47
- fix websocket -> reality
03.09.2024 v1.46.2
- fix link v2ray
03.09.2024 v1.46.1
- fix import
- fix websocket domain
03.09.2024 v1.46
- возможность добавить кастомный поддомен для Letsencrypt
03.09.2024 v1.45