From 678fe04d9a2f27d3b286cba5eabede5dff1aa89e Mon Sep 17 00:00:00 2001 From: mercury Date: Sun, 3 May 2026 00:25:59 +0400 Subject: [PATCH] fix wg-in xray inbound --- app/bot.php | 49 +++++++++++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 20 deletions(-) diff --git a/app/bot.php b/app/bot.php index e5136ba..313c283 100644 --- a/app/bot.php +++ b/app/bot.php @@ -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'],