mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5435] [Bug]: Possible issues with VLESS outbound structure and XHTTP parsing #3799
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#3799
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 @MohsenBg on GitHub (Jun 19, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5435
Describe the bug
Hi,
While implementing a compatible VLESS/XHTTP parser for another project, I was comparing my output with the parser in
internal/util/link/outbound.goand noticed two things that I wasn't sure were intentional.1. VLESS outbound structure
Current code:
Source:
github.com/MHSanaei/3x-ui@4915d6b18d/internal/util/link/outbound.go (L273-L284)The structure above appears different from the VLESS outbound schema commonly used by Xray, which is usually:
Is there another conversion step later that transforms the flat structure into a standard Xray outbound, or is this intentional?
2. XHTTP advanced fields
Current implementation:
github.com/MHSanaei/3x-ui@4915d6b18d/internal/util/link/outbound.go (L598-L610)places advanced fields directly under
xhttpSettings:However, according to the Xray XHTTP examples, fields such as:
appear to belong under:
Reference:
https://github.com/XTLS/Xray-core/discussions/4113
While implementing my own parser I ended up handling it roughly like this:
I am not sure whether the current behavior is intentional, based on an older XHTTP schema, or whether this may be a bug/incompatibility.
Could someone clarify the intended behavior?
How to reproduce the problem
How to reproduce the problem
Start from a clean environment with a working Go project.
Clone the repository and checkout the referenced commit:
Locate the outbound parser implementation:
Parse a sample VLESS link using the parser (call the parsing function used in the project).
Example link:
Observe the generated outbound structure for VLESS:
settingsfield in the outputvnext/usersnesting)Compare the output with a standard Xray VLESS outbound configuration schema.
Repeat the same process for XHTTP links:
xhttpSettingsCompare with Xray XHTTP specification:
https://github.com/XTLS/Xray-core/discussions/4113
Notice that several fields expected under
xhttpSettings.extraappear at the top level instead.Expected behavior
No response
Actual behavior
No response
Relevant logs
Screenshots
No response
3x-ui version
3.3.1
Xray-core version
26.6.1
How did you install 3x-ui?
install.sh script
Operating system
Ubuntu24.0.4
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 19, 2026):
Both observations are confirmed against the current source at v3.3.1.
1. VLESS outbound structure — confirmed bug
parseVlessininternal/util/link/outbound.go(lines 273–285) emits a flatsettingsmap without thevnext/usersnesting that the Xray VLESS outbound schema requires. By contrast,parseVmessin the same file (lines 212–226) correctly nestsvnext/users, andparseTrojan(lines 319–325) correctly nestsservers. No downstream transformation corrects the VLESS output: parsed outbounds are merged directly into the Xray runtime config bymergeSubscriptionOutbounds(internal/web/service/xray.go:567) and serialised as-is byparsedExternalOutbound(internal/sub/external_config.go:139–149). A VLESS entry pulled from an outbound subscription therefore injects invalid JSON into the Xray config.One additional touch-point that would need updating alongside any fix:
extractOutboundEndpointsininternal/web/service/outbound/outbound.go(lines 251–252) also readssettings["address"]andsettings["port"]from the flat map and would need to traversevnext[0]instead, matching the VMess path already there on lines 244–250.2. XHTTP
extranesting — partially confirmedapplyTransport(outbound.go, lines 598–610) reads individual query parameters (xPaddingBytes,scMaxEachPostBytes,scMinPostsIntervalMs,uplinkChunkSize) and sets them as direct keys ofxhttpSettings.buildStream(lines 547–553) also seedsxPaddingBytesat the top level ofxhttpSettings, with a comment referencing #5141 on fingerprinting concerns.Two distinct gaps are present:
extraquery parameter (a JSON blob, as in the sample link you supplied) is not read at all by the current parser. Fields carried inside that blob — such asxPaddingHeader,xPaddingKey,xPaddingMethod,xPaddingObfsMode,xPaddingPlacement— are silently dropped.xPaddingBytes, etc.) should be placed directly underxhttpSettingsor nested underxhttpSettings.extradepends on which XHTTP config schema the running Xray-core version expects. The repo importsgithub.com/xtls/xray-core v1.260327.1-0.20260601021109-94ffd50060f1(go.mod:24); that library is not vendored in-repo, so verifying against itsXHTTPConfigstruct directly would confirm the correct placement.Related closed issues for context: #4406 (UI "Convert" path for XHTTP outbounds), #4107 (feature request for xhttp extra field support in outbound), #5141 (fingerprinting via
scMinPostsIntervalMsseed value).This reply was generated automatically; a maintainer may follow up.