mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5105] [Bug]: MTProto inbound doesn't export properly #3587
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#3587
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 @femdiya on GitHub (Jun 9, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5105
Describe the bug
After the creation of MTProto inbound, the remark chosen by user will get added to the end of the export URL, such as: tg://proxy?server=1.1.1.1&port=443&secret=xxx#remark
This format is not supported on Telegram Desktop, thus, leading to "This proxy link is invalid" error. Plus, it is mainly useless for now as across multiple Telegram clients, adding remarks is meaningless and unsupported.
How to reproduce the problem
Expected behavior
The remark should not be added at the end of export URL as it is meaningless across different Telegram clients.
Actual behavior
The remark gets added at the end of export URL.
Relevant logs
Screenshots
No response
3x-ui version
3.3.0
Xray-core version
No response
How did you install 3x-ui?
install.sh script
Operating system
Ubuntu
Which parts of the panel are affected?
No response
Browser (only if it is a UI bug)
No response
Is the panel behind a reverse proxy or CDN?
None
Before submitting
@github-actions[bot] commented on GitHub (Jun 9, 2026):
Thanks for the clear report. This is a confirmed bug in the current codebase (v3.3.0).
Root cause
The remark is being appended as a URL fragment (after
#) to thetg://proxydeep link in two places:frontend/src/lib/xray/inbound-link.tsline 701:This produces:
tg://proxy?server=...&port=...&secret=...#YourRemarksub/subService.goline 406:The third argument to
buildLinkWithParamsis the fragment; it ends up appended as#remarkviaappendQueryAndFragment(lines 1392–1396 of the same file).The
tg://proxyURL scheme does not define a#fragmentcomponent. Telegram Desktop rejects any such URL with the error you saw.The fix is to pass an empty string as the fragment for MTProto links in both locations — simply omit the remark from the exported URL. No other protocol is affected; for VLESS, VMess, Trojan, Shadowsocks, etc., the
#remarkconvention is well-supported. MTProto is the only outlier.