mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #6738] [Bug]: Host serverDescription is not appended to hysteria2:// subscription links (works for VLESS) #4491
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#4491
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 @R0me0Star on GitHub (Oct 5, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6738
Describe the bug
A host with a "Description" (serverDescription) is attached to two inbounds on the same node: one VLESS (xhttp + Reality) and one Hysteria2. In the subscription output the VLESS link gets the
?serverDescription=<base64>suffix after the remark, but the hysteria2:// link for the same host does not. As a result Happ shows the custom subtitle for VLESS servers and the default "Hysteria | hysteria | TLS" for Hysteria2 servers.Related: #6488 (added serverDescription escaping for inbound/host links), #6575 (same parameter lost for external links).
How to reproduce the problem
curl -s -A "Happ/3.0.0" "https:////" | base64 -d
Expected behavior
Both links carry the host description:
vless://...#?serverDescription=V2ktRmk=
hysteria2://...#?serverDescription=V2ktRmk=
Actual behavior
Only the VLESS link has it. Fragments from the real subscription (same host, two inbounds):
%F0%9F%87%B5%F0%9F%87%B1%20%D0%9F%D0%BE%D0%BB%D1%8C%D1%88%D0%B0%20%F0%9F%8E%B5?serverDescription=V2ktRmk= <- vless
%F0%9F%87%B5%F0%9F%87%B1%20%D0%9F%D0%BE%D0%BB%D1%8C%D1%88%D0%B0%20%F0%9F%8E%B5%F0%9F%8E%AE <- hysteria2
The same happens for every host: 4 of 4 VLESS links have the parameter, 4 of 4 Hysteria2 links do not.
Relevant logs
Screenshots
No response
3x-ui version
3.9.0
Xray-core version
26.9.30
How did you install 3x-ui?
install.sh script
Operating system
Ubuntu 24.04
Which parts of the panel are affected?
Subscription (share links / Clash / JSON)
Browser (only if it is a UI bug)
No response
Is the panel behind a reverse proxy or CDN?
No — direct access
Before submitting
@github-actions[bot] commented on GitHub (Oct 5, 2026):
This is a real bug, and it is still present on the default branch. The Hysteria/Hysteria2 link builder has its own per-endpoint loop. That loop never adds the host's
serverDescriptionto the remark, sohysteria2://links never get the?serverDescription=<base64>suffix. VLESS, Trojan and Shadowsocks use a shared endpoint renderer that does add it.The host's description does reach the Hysteria code.
internal/sub/host_sub.go:113-115copies it onto the endpoint map:The shared renderer that
vless://goes through then adds it to the remark, ininternal/sub/endpoint.go:138-141(buildEndpointLinks):genHysteriaLinkdoes not use that renderer. Its ownexternalProxyloop builds the fragment straight fromendpointRemark, which returns only the remark (internal/sub/host_sub.go:259-271). Nothing in that loop readsep["serverDescription"]. Frominternal/sub/service.go:1537-1538:The fragment escaping is not the problem.
buildLinkWithParamsrunsescapeLinkFragment(internal/sub/service.go:2366-2375), which keeps a valid?serverDescription=tail as-is. The suffix is simply never added for Hysteria. This matches what you saw: 4 of 4 VLESS links have the parameter and 4 of 4 Hysteria2 links don't.There is no workaround in the panel settings for Hysteria2 links in the raw subscription.
Verdict: Confirmed bug
Severity: Low
Confidence: High
Root cause:
internal/sub/service.go:1538,genHysteriaLink: the per-host/externalProxy loop passess.endpointRemark(...)as the fragment withoutappendHappServerDescription. Every host attached to a Hysteria (v1 or v2) inbound is affected; VLESS/Trojan/SS go throughbuildEndpointLinks(internal/sub/endpoint.go:138-141) and are fine.Already fixed: Still present on the default branch (
d4a7086c)Duplicate of: Related: #6575 (a different cause: an existing
?serverDescription=was percent-encoded for external links; that fix,escapeLinkFragment, does not cover a suffix that is never added)Evidence:
internal/sub/host_sub.go:113-115(description put on the endpoint);internal/sub/endpoint.go:138-141(added for URL-param protocols);internal/sub/service.go:1537-1538(Hysteria loop leaves it out);internal/sub/service.go:2364-2375(the escaping would keep it if it were there)Not determined: Whether other generators with their own loops (outside
buildEndpointLinks/buildEndpointVmessLinks) have the same gap. A grep for callers ofendpointRemarkininternal/sub/would settle it.Suggested fix: In the
genHysteriaLinkexternalProxy loop, pass the remark throughappendHappServerDescriptionusingep["serverDescription"], the same waybuildEndpointLinksdoes. A regression test ininternal/subshould check that a hysteria2 host link's fragment ends in?serverDescription=<base64>.This reply was generated automatically; a maintainer may follow up.