mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5515] [Feature]: More MtProto Users (Secret) #3849
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#3849
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @CodeRoK7 on GitHub (Jun 23, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5515
Is your feature request related to a problem?
Hello.
Add the ability to create multiple Secret keys within a single section, so that multiple Secret users can be served on a single port and configuration, rather than just one as is currently the case.
Describe the solution you'd like
!
Alternatives you've considered
!
Concrete use case
No response
Mockups, screenshots, or examples
No response
Which parts of the panel would this affect?
No response
Are you willing to help?
Before submitting
@github-actions[bot] commented on GitHub (Jun 23, 2026):
The current architecture makes this non-trivial to implement, and the core blocker is the underlying
mtgbinary itself.How MTProto inbounds work today
3x-ui does not run MTProto through Xray-core. Instead, it spawns one
mtg(github.com/9seconds/mtg v2) sidecar process per MTProto inbound — one process per port — and generates a TOML config for each one (internal/mtproto/manager.go,renderConfig). That generated config contains a single scalar secret field:The panel's
Instancestruct (internal/mtproto/manager.go:21) likewise holds exactly oneSecret string. There is no array or list of secrets anywhere in the current data model, config generation, or database schema.Why multiple secrets per port is not straightforward
The mtg v2 TOML format accepts a single
secretvalue per process; it has no configuration key for a list of secrets. Supporting multiple secrets on a single port would require one of:secrets = [...]configuration option. That is an upstream feature request at github.com/9seconds/mtg, not something 3x-ui can address on its own.Current workaround
The existing approach to serve multiple secrets is to create multiple MTProto inbounds. Each gets a separate port and a separate
mtgprocess with its own secret. Clients are simply given the appropriate per-port link. This is less elegant than a single shared port but is fully functional with the current stack.If this feature is important to you, the most actionable path is to open or upvote an issue at the mtg repository (github.com/9seconds/mtg) requesting multi-secret support in the TOML config. If mtg adds it, the panel-side changes (
Instance,renderConfig, the database settings JSON, and the UI form) would be the follow-on work.This reply was generated automatically; a maintainer may follow up.
@CodeRoK7 commented on GitHub (Jun 23, 2026):
Here it is https://github.com/nolaxe/install-MTProxy. it is implemented, one port, many secrets and no problems. It is convenient than creating a bunch of separate ports with mtproto sections.
@CodeRoK7 commented on GitHub (Jun 24, 2026):
in the end, it looks like this, meaning that all the added users have the same IP and port for connecting, but different SECRET