mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 19:11:53 +07:00
[GH-ISSUE #6826] [Question]: Сlient receives an incorrect subscription link via the Telegram bot. #4544
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#4544
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 @0dementiy0-source on GitHub (Oct 14, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6826
What are you trying to do?
After clicking the link — the invitation — the client receives an incorrect link for subscribing via the Telegram bot. Instead of an IP address, the link contains a local hostname. In the client’s web interface, the link is correct. How can I change the hostname in the link to an IP address?
What have you already tried?
Nothing
3x-ui version
3.1.0
How did you install 3x-ui?
install.sh script
Operating system
Ubuntu 24.04
Screenshots or config snippets
No response
Before submitting
@github-actions[bot] commented on GitHub (Oct 14, 2026):
The bot falls back to the server's OS hostname because it has no browser request to take a host from. You can fix it with one setting: put your public IP into Panel Settings → Subscription →
Reverse Proxy URI(subURI). #5851 had the same cause, so I'm closing this as a duplicate of it.Why the web UI and the bot differ
subDomainis empty, the panel builds the link from the host in your browser's address bar.BuildSubURIBase(internal/web/service/setting.go:1913-1915):buildSubscriptionURLs(internal/web/service/tgbot/tgbot_client.go:167-176) falls back to the panel domain, then the OS hostname, thenlocalhost:How to fix it
setting.go:400), so copy it instead of typing/sub/.Reverse Proxy URI, without the client's ID at the end. For example:subJsonURI).The bot uses these fields exactly as written whenever they are set (
tgbot_client.go:203-207and212-216). The web UI readssubURItoo, so both will show the same link.I'd avoid putting the IP into the subscription
Listen Domain(subDomain) instead. That field also turns on host checking for the subscription server (internal/sub/sub.go:63-64,DomainValidatorMiddleware(subDomain)), so requests that arrive under any other name would be rejected.Verdict: Duplicate
Severity: N/A
Confidence: High
Root cause:
buildSubscriptionURLs(internal/web/service/tgbot/tgbot_client.go:167-176) falls back towebDomain, thenos.Hostname(), whensubURI/subDomainare empty; the web UI uses the request Host instead (setting.go:1913-1915). Introduced with the bot's subscription links ined96fa09("tgbot: subscription,qrcode, link").Same class: None found beyond the three bot callers of
buildSubscriptionURLs(tgbot_client.go:229,265,300), which all share this fallbackAlready fixed: Still present on the default branch (v3.10.2); the hostname fallback is unchanged
Duplicate of: #5851, same hostname fallback in
buildSubscriptionURLs; also Related: #6021Evidence:
tgbot_client.go:167-176and203-207;setting.go:1907-1924(BuildSubURIBase);internal/sub/sub.go:63-64Not determined: None
This reply was generated automatically; a maintainer may follow up.