mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5655] [Bug]: VLESS Route field for hosts is ignored #3937
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#3937
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 @imtama on GitHub (Jun 29, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5655
Describe the bug
When entering a Vless Route value for a host in the panel, according to the Xray-core documentation, it should be inserted here into the user's UUID:
However, the panel still provides the original UUID in subscriptions.
How to reproduce the problem
Expected behavior
No response
Actual behavior
No response
Relevant logs
Screenshots
No response
3x-ui version
3.4.1
Xray-core version
26.6.1
How did you install 3x-ui?
install.sh script
Operating system
Ubuntu
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 response
Before submitting
@github-actions[bot] commented on GitHub (Jun 29, 2026):
The
VlessRoutefield is stored in the database but never included in any subscription output — confirmed against the current source (v3.4.1 / commit7a5d6da).What the code shows:
Hostmodel (internal/database/model/model.go:777) asVlessRoute string, described as a "free-form port/range routing spec (e.g. '53,443,1000-2000')". The UI hint ininternal/web/translation/en-US.jsonreads: "Ports/ranges routed via VLESS, e.g. 53,443,1000-2000. Leave blank for none."frontend/src/pages/hosts/HostFormModal.tsx:262binds correctly and the value is persisted.hostToExternalProxyMap()ininternal/sub/host_sub.go:45–107converts aHostrecord into the endpoint map that subscription renderers consume. It maps every other host field (sni,fingerprint,alpn,pinnedPeerCertSha256,echConfigList,allowInsecure,hostHeader,path,muxParams,sockoptParams,finalMask, etc.) but never addsVlessRouteto the map.VlessRoutenever reaches the endpoint map,genVlessLink()ininternal/sub/service.go:656–712has no way to apply it. The UUID is taken verbatim fromclients[clientIndex].ID(line 664) with no modification, and noroutingquery parameter is appended to the link.Clarification needed on expected behavior:
The panel's own model comment and translation describe
VlessRouteas a port/range spec intended to appear as a routing hint in subscription links (e.g. arouting=53,443,1000-2000query parameter), which is how some clients interpret it. The issue report, however, states the value should be embedded directly into the UUID at the third group (xxxxxxxx-xxxx-0000-xxxx-xxxxxxxxxxxx), citing the Xray-core routing docs.To help maintainers scope the fix correctly: which client app are you testing against, and what exact subscription output format does it expect for this field? Specifically:
VlessRouteappear as a URL query parameter in the VLESS URI (and if so, what key name)?The root cause (the field is stored but never emitted) is confirmed regardless of which output format is correct.
This reply was generated automatically; a maintainer may follow up.
@MHSanaei commented on GitHub (Jun 29, 2026):
Fixed in
d8221a81.The Host VLESS Route field was stored and shown in the panel but never applied to subscription output. It is now baked into the per-client UUID's 3rd group (bytes 6-7, big-endian uint16) — exactly what Xray reads via
net.PortFromBytes(userSentID[6:8])— across raw, JSON and Clash subscriptions. Because Xray masks those two bytes to zero before authenticating the user (ProcessUUID), the modified UUID still authenticates while carrying the route value.A couple of notes on the field itself:
0–65535(e.g.443→ UUID 3rd group01bb). A UUID's 3rd group holds exactly one uint16, so the previous multi-segment form (53,443,1000-2000) was incorrect for this field — that spec belongs to the separate server-side routing rule (routing.rules[].source.vlessRoute).Frontend validation, the in-panel link preview, and the hint/error strings in all 13 locales were updated to match, and tests were added on every path (helper, raw, JSON, Clash, multi-host).