[PR #5076] [MERGED] feat(mtproto): add MTProto (FakeTLS) protocol via managed mtg sidecar #5770

Closed
opened 2026-11-02 04:03:57 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/5076
Author: @MHSanaei
Created: 6/8/2026
Status: ✅ Merged
Merged: 6/8/2026
Merged by: @MHSanaei

Base: main ← Head: mtproto


📝 Commits (5)

  • df6d13d feat(mtproto): add MTProto (FakeTLS) protocol via managed mtg sidecar
  • d79d314 Merge branch 'main' into mtproto
  • a064f62 fix
  • 2b2d68b fix
  • 83d3163 fix: address Copilot review comments on mtproto PR

📊 Changes

46 files changed (+1381 additions, -9 deletions)

View changed files

📝 .github/workflows/release.yml (+19 -0)
📝 DockerInit.sh (+12 -0)
📝 database/model/model.go (+68 -1)
➕ database/model/model_mtproto_test.go (+71 -0)
📝 frontend/public/openapi.json (+2 -1)
📝 frontend/src/generated/schemas.ts (+2 -1)
📝 frontend/src/generated/zod.ts (+1 -1)
📝 frontend/src/lib/xray/inbound-defaults.ts (+41 -1)
📝 frontend/src/lib/xray/inbound-link.ts (+24 -0)
📝 frontend/src/pages/inbounds/form/InboundFormModal.tsx (+4 -0)
📝 frontend/src/pages/inbounds/form/protocols/index.ts (+1 -0)
➕ frontend/src/pages/inbounds/form/protocols/mtproto.tsx (+40 -0)
📝 frontend/src/pages/inbounds/info/InboundInfoModal.tsx (+29 -0)
📝 frontend/src/schemas/primitives/protocol.ts (+2 -0)
📝 frontend/src/schemas/protocols/inbound/index.ts (+3 -0)
➕ frontend/src/schemas/protocols/inbound/mtproto.ts (+10 -0)
📝 frontend/src/test/__snapshots__/protocol-capabilities.test.ts.snap (+168 -0)
📝 frontend/src/test/__snapshots__/protocols.test.ts.snap (+10 -0)
➕ frontend/src/test/golden/fixtures/inbound/mtproto-basic.json (+7 -0)
📝 install.sh (+9 -0)

...and 26 more files

📄 Description

Xray-core has no mtproto proxy, so mtproto inbounds run as standalone mtg (9seconds/mtg) sidecar processes managed by the panel — one per inbound — and are excluded from the generated Xray config entirely.

  • model: MTProto protocol constant, validator, and FakeTLS secret helpers (GenerateFakeTLSSecret/HealMtprotoSecret)
  • mtproto package: per-inbound mtg process manager with reconcile, graceful stop, and best-effort Prometheus traffic scraping
  • runtime: delegate mtproto inbounds to the mtg manager instead of the Xray gRPC API; skip mtproto when building the Xray config
  • web: boot reconcile + StopAll wiring, periodic reconcile/traffic job, port-conflict transport, secret healing on inbound add/update
  • sub: tg:// proxy share-link generation
  • frontend: protocol option, Zod schema, Protocol tab (FakeTLS domain + regenerable secret), info-modal link, and i18n
  • provisioning: fetch mtg v2.2.8 in install.sh, DockerInit.sh, and the Linux + Windows release workflows

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/MHSanaei/3x-ui/pull/5076 **Author:** [@MHSanaei](https://github.com/MHSanaei) **Created:** 6/8/2026 **Status:** ✅ Merged **Merged:** 6/8/2026 **Merged by:** [@MHSanaei](https://github.com/MHSanaei) **Base:** `main` ← **Head:** `mtproto` --- ### 📝 Commits (5) - [`df6d13d`](https://github.com/MHSanaei/3x-ui/commit/df6d13d0ee1d83a8b58eaca7dd86877912faab30) feat(mtproto): add MTProto (FakeTLS) protocol via managed mtg sidecar - [`d79d314`](https://github.com/MHSanaei/3x-ui/commit/d79d3141288e393e08d42ffa03ab9f4284a03151) Merge branch 'main' into mtproto - [`a064f62`](https://github.com/MHSanaei/3x-ui/commit/a064f628891de1816bb114eb7022e35d90cb137e) fix - [`2b2d68b`](https://github.com/MHSanaei/3x-ui/commit/2b2d68b5c4e1aa2f75f6283a9284212b1f9d870e) fix - [`83d3163`](https://github.com/MHSanaei/3x-ui/commit/83d3163b549e560838bb0309f3aaa4bb53863fc0) fix: address Copilot review comments on mtproto PR ### 📊 Changes **46 files changed** (+1381 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/release.yml` (+19 -0) 📝 `DockerInit.sh` (+12 -0) 📝 `database/model/model.go` (+68 -1) ➕ `database/model/model_mtproto_test.go` (+71 -0) 📝 `frontend/public/openapi.json` (+2 -1) 📝 `frontend/src/generated/schemas.ts` (+2 -1) 📝 `frontend/src/generated/zod.ts` (+1 -1) 📝 `frontend/src/lib/xray/inbound-defaults.ts` (+41 -1) 📝 `frontend/src/lib/xray/inbound-link.ts` (+24 -0) 📝 `frontend/src/pages/inbounds/form/InboundFormModal.tsx` (+4 -0) 📝 `frontend/src/pages/inbounds/form/protocols/index.ts` (+1 -0) ➕ `frontend/src/pages/inbounds/form/protocols/mtproto.tsx` (+40 -0) 📝 `frontend/src/pages/inbounds/info/InboundInfoModal.tsx` (+29 -0) 📝 `frontend/src/schemas/primitives/protocol.ts` (+2 -0) 📝 `frontend/src/schemas/protocols/inbound/index.ts` (+3 -0) ➕ `frontend/src/schemas/protocols/inbound/mtproto.ts` (+10 -0) 📝 `frontend/src/test/__snapshots__/protocol-capabilities.test.ts.snap` (+168 -0) 📝 `frontend/src/test/__snapshots__/protocols.test.ts.snap` (+10 -0) ➕ `frontend/src/test/golden/fixtures/inbound/mtproto-basic.json` (+7 -0) 📝 `install.sh` (+9 -0) _...and 26 more files_ </details> ### 📄 Description Xray-core has no mtproto proxy, so mtproto inbounds run as standalone mtg (9seconds/mtg) sidecar processes managed by the panel — one per inbound — and are excluded from the generated Xray config entirely. - model: MTProto protocol constant, validator, and FakeTLS secret helpers (GenerateFakeTLSSecret/HealMtprotoSecret) - mtproto package: per-inbound mtg process manager with reconcile, graceful stop, and best-effort Prometheus traffic scraping - runtime: delegate mtproto inbounds to the mtg manager instead of the Xray gRPC API; skip mtproto when building the Xray config - web: boot reconcile + StopAll wiring, periodic reconcile/traffic job, port-conflict transport, secret healing on inbound add/update - sub: tg:// proxy share-link generation - frontend: protocol option, Zod schema, Protocol tab (FakeTLS domain + regenerable secret), info-modal link, and i18n - provisioning: fetch mtg v2.2.8 in install.sh, DockerInit.sh, and the Linux + Windows release workflows --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:03:57 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#5770
No description provided.