🔧 Маскировка 443: фикс петли, жравшей сокеты
Симптом: включил маскировку — счётчик TCP-сокетов улетает в десятки тысяч, панель падает от OOM, даже когда ни одного клиента не подключено.
Причина: Xray REALITY на каждое входящее TLS-соединение дозванивается до dest — так устроен стил. Если в dest указан свой же домен/IP (а форма панели сохраняет его как target), каждый сканер зацикливается: Caddy → Xray → dest → Caddy… Публичный :443 сканируют тысячи ботов 24/7 — сокеты множились даже без клиентов.
Что сделано:
1️⃣ Авто-стил: если dest/target смотрит на собственный сервер (домен публик-хоста, IP, loopback) — Apply принудительно переписывает его на 127.0.0.1:<порт Cover-сайта>. TLS терминируется внутри шлюза, дальше петли нет. Реверт возвращает как было.
2️⃣ Здоровый внешний dest (типа microsoft.com) не трогается — правило lucx.269 соблюдено.
3️⃣ Видна форма панели: читается и target, и легаси dest (PR #125, спасибо @rudenko-ks — словил 14k коннектов и OOM у себя).
4️⃣ Галочка «steal» для здоровых dest снова работает (была мёртвой).
5️⃣ Обновлена brace-expansion 5.0.12 (high severity npm audit).
Что делать: обновить панель (x-ui update), открыть маскировку — строки с петлёй пометятся, Apply переставит dest сам. После Apply сокеты в норме.
⚡️ Приятного использования!
🔧 Masking 443: the socket-eating loop is fixed
Symptom: turn on masking and the open-socket counter explodes to tens of thousands, the panel dies from OOM even with zero clients connected.
Cause: Xray REALITY dials dest on every accepted TLS connection — that is how the steal works. If dest points back at the same server (your own domain/IP, saved as target by the panel form), every scanner probe recurses Caddy → Xray → dest → Caddy… The public :443 gets hammered by thousands of bots 24/7, so sockets multiplied with no clients attached.
What's done:
✅ Auto-steal: when dest/target references this very server (public host domain, IP, loopback), Apply rewrites it to 127.0.0.1:<cover site port>. TLS terminates inside the gateway — no more recursion. Revert restores the original.
✅ A healthy external dest (like microsoft.com) is never touched (lucx.269 rule kept).
✅ Panel-saved inbounds are handled: both target and the legacy dest are read (PR #125, thanks @rudenko-ks — caught ~14k conns and OOM in the wild).
✅ The "steal" checkbox for healthy dests works again (it was dead).
✅ brace-expansion bumped to 5.0.12 (high severity npm audit).
What to do: update the panel (x-ui update), open Masking — looped rows are marked, Apply fixes dest on its own. Sockets stay normal after Apply.
⚡️ Enjoy!