mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
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#3806
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 @scan666github on GitHub (Jun 20, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5446
Describe the bug
This looks like a regression of #4364.
In 3x-ui v3.3.1, VLESS + REALITY + XHTTP
packet-upshare/subscription links can include both:When this link is imported into Karing 1.2.19.2209 on iOS, Karing stores the server without
transport.mode. The imported profile then fails its latency test with:The server receives TCP connections on port 443, but the client does not reach a successful VLESS/XHTTP request. 3x-ui counters for the client stay at 0 and there are no successful
email: ...access log entries.If the same client is imported with a "clean" A0-style link that keeps
mode=packet-upas a flat parameter but removesextraandx_padding_bytes, Karing imports it correctly and the connection works immediately.How to reproduce the problem
packet-up/assets/api/eventsxPaddingBytes:100-1000Generated link shape
Sanitized example of the failing link shape generated by 3x-ui v3.3.1:
Karing stores this approximately as:
Notice that
transport.modeis missing.Workaround
If the link is manually rewritten to remove
extraandx_padding_bytes, while keepingmode=packet-up, Karing imports it correctly and the same server/client works:After importing this clean link:
last_onlineupdates.inbound-443 -> outboundTag email: TAG.Why this looks like a regression
Issue #4364 described almost the same Karing symptom: after importing a newer subscription, Karing stored XHTTP transport with padding fields but without
mode, causingio: read/write on closed pipe.Commit
01a7dc807beaa8007ed83010b2c99424b5fb18f7closed #4364 with:However, in v3.3.1 the current
frontend/src/lib/xray/inbound-link.tshas:but
buildXhttpExtra()does not addmodeintoextra.So the generated link has flat
mode=packet-up, butextraonly contains padding fields. Karing appears to prefer/parse theextrapayload and drops the flatmode, reproducing #4364.Expected behavior
Karing-compatible share/subscription links should preserve XHTTP
mode=packet-upafter import.Possible fixes:
modein the XHTTPextraJSON again whenextrais emitted, orextra/x_padding_bytesin share links unless needed, orActual behavior
Karing imports the server without
transport.mode, then fails with:3x-ui version
v3.3.1
Xray-core version
26.6.1
Client
Karing 1.2.19.2209 on iOS.
Shadowrocket and a direct Xray 26.6.1 client work with the same server/client parameters.
Before submitting
@github-actions[bot] commented on GitHub (Jun 20, 2026):
The regression is confirmed against the current source. Here is what the investigation found.
Root cause
The fix for #4364 (commit
01a7dc807) taught both the Go subscription service and the JS frontend to includemodeinside theextraJSON blob so that clients which parseextra(rather than flat URL params) would still see it. When the codebase was later refactored —sub/subService.go→internal/sub/service.go,frontend/src/models/inbound.js→frontend/src/lib/xray/inbound-link.ts— themodefield was not carried forward into the newbuildXhttpExtraimplementations. The flatmode=packet-upURL parameter is still set, butextranow only containsxPaddingBytesand the other bidirectional fields.Karing 1.2.19.2209 appears to populate
transportfrom theextraJSON whenextrais present, which causes the flatmodeparam to be silently dropped, reproducing the exact symptom from #4364.Confirmed locations in the current source
internal/sub/service.go, functionbuildXhttpExtra(line 1632): does not includemodein the returned map. The flat param is set on line 1767 ofapplyXhttpExtraParams, butbuildXhttpExtra(called on line 1775) returns anextraobject withoutmode.frontend/src/lib/xray/inbound-link.ts, functionbuildXhttpExtra(line 46): similarly does not includemode. The flat param is written on line 274 ofapplyXhttpExtraToParams, but theextraJSON built on line 278 omits it.This means that whenever
xPaddingBytesor any other bidirectional field is non-empty, the generated link carries:Karing reads
extra, findsxPaddingBytes, storestransport.type=xhttpandtransport.x_padding_bytes, but never seesmode, leavingtransport.modeabsent.Minimal fix
In both files,
buildXhttpExtraneeds to emitmodewhen it is non-empty, mirroring what commit01a7dc807did for the old files:internal/sub/service.go— add insidebuildXhttpExtra, alongside the other field extractions:frontend/src/lib/xray/inbound-link.ts— add insidebuildXhttpExtra, before thestringFieldsblock:Both changes are identical in intent to the original fix from commit
01a7dc807. The flatmodeparam should be kept as-is alongsideextra.mode; removing it would break clients that read only flat params.Scope
Affects share links (generated in the browser via
inbound-link.ts) and subscription links (generated server-side inservice.go) whenever XHTTP is used with any bidirectional extra field set (xPaddingBytes,uplinkHTTPMethod,xmux,downloadSettings, custom headers, etc.). Clients that read only flat URL params (v2rayNG, Shadowrocket, direct Xray) are unaffected.This reply was generated automatically; a maintainer may follow up.