fix wg-in xray inbound

This commit is contained in:
mercury
2026-05-03 00:25:59 +04:00
parent 2363a04af3
commit 678fe04d9a
+29 -20
View File
@@ -797,29 +797,11 @@ class Bot
$c['log']['access'] = '/logs/xray';
foreach ($c['inbounds'] as $v) {
if ($v['tag'] == 'api') {
$inbound = true;
$api = true;
break;
}
}
if (empty($inbound)) {
$c['inbounds'][] = [
"port" => 10808,
"protocol" => "socks",
"settings" => [
"auth" => "noauth",
"udp" => true,
"ip" => "0.0.0.0"
],
"tag" => "wg-in",
"sniffing" => [
"destOverride" => [
"http",
"tls",
"quic"
],
"enabled" => true
]
];
if (empty($api)) {
$c['inbounds'][] = [
"listen" => "127.0.0.1",
"port" => 8080,
@@ -843,6 +825,33 @@ class Bot
"type" => "field"
];
}
foreach ($c['inbounds'] as $v) {
if ($v['tag'] == 'wg-in') {
$wg = true;
break;
}
}
if (empty($wg)) {
$c['inbounds'][] = [
"port" => 10808,
"protocol" => "socks",
"settings" => [
"auth" => "noauth",
"udp" => true,
"ip" => "0.0.0.0"
],
"tag" => "wg-in",
"sniffing" => [
"destOverride" => [
"http",
"tls",
"quic"
],
"enabled" => true
]
];
}
$c['stats'] = new stdClass();
$c['api'] = [
'services' => ['StatsService'],