mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #6312] [Bug]: TCP Test fails for VLESS outbounds with standard vnext configuration format ("No testable endpoint") #4286
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#4286
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 @catmarcus on GitHub (Aug 25, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6312
Describe the bug
When creating a vless outbound that strictly follows the official Xray standard configuration format (using the vnext array for endpoints), the internal TCP test in the panel (/panel/api/xray/testOutbounds) fails to extract the address and port. It returns a "No testable endpoint" error or 0ms delay, even though the outbound is perfectly valid and actual proxy traffic (HTTP/SOCKS) flows through it flawlessly.
How to reproduce the problem
Create a vless outbound in the panel with a standard Xray vnext JSON structure in the settings block, for example:
json
{
"vnext": [
{
"address": "example.domain.com",
"port": 443,
"users": [
{
"id": "uuid-here",
"encryption": "none"
}
]
}
]
}
Click the "Test" (TCP ping) button for this outbound.
The UI will indicate that there is no testable endpoint, because the backend fails to parse the IP/Port.
Root Cause:
The bug is located in internal/web/service/outbound/outbound.go within the extractOutboundEndpoints function.
While the vmess protocol correctly iterates over the vnext array to extract endpoints, the vless protocol explicitly hardcodes the extraction to the root of the settings object (settings["address"]). This breaks compatibility with strict Xray configurations that correctly place the address inside the vnext array.
Current implementation (internal/web/service/outbound/outbound.go ~line 259):
go
case "vless":
addServer(settings["address"], settings["port"])
Proposed Fix:
Update the vless case in extractOutboundEndpoints to parse the vnext array identically to vmess, while keeping a fallback to the root address/port to preserve backward compatibility with legacy flat configurations generated by older versions of the panel.
go
case "vless":
if vnext, ok := settings["vnext"].([]any); ok {
for _, v := range vnext {
if vm, ok := v.(map[string]any); ok {
addServer(vm["address"], vm["port"])
}
}
}
// Fallback for legacy flat configs
if settings["address"] != nil {
addServer(settings["address"], settings["port"])
}
Expected behavior
No response
Actual behavior
No response
Relevant logs
Screenshots
No response
3x-ui version
3.7.0
Xray-core version
26.6.27+
How did you install 3x-ui?
install.sh script
Operating system
Ubuntu 24.04
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 (Aug 25, 2026):
Confirmed — your reading of the code is correct.
extractOutboundEndpointshandles VLESS only in the panel's flat wire shape, so avnext-shaped VLESS outbound yields zero endpoints and the TCP probe short-circuits with"No testable endpoint". It is still present on the default branch (v3.7.0).The deciding lines,
internal/web/service/outbound/outbound.go:251-260:addServeronly appends whenhost != "" && p > 0(outbound.go:246), so withvnextpresent and no top-leveladdress,outstays empty andtestOutboundTCPreturns atoutbound.go:164-166:This is the default path: the outbounds tab starts in TCP mode (
frontend/src/pages/xray/outbounds/OutboundsTab.tsx:125—useState<OutboundTestMode>('tcp')). Only TCP mode is affected;modevalues other than"tcp"route through a temporary Xray instance (internal/web/service/outbound/probe_http.go:171) and never call the extractor.Two workarounds, both available today:
vnexton load (frontend/src/lib/xray/outbound-form-adapter.ts:122-131) and writes the flat shape back out (vlessToWire, same file:507-514), so one save normalises the stored settings and the TCP test starts working.One correction to the report's framing: 3x-ui's canonical VLESS outbound shape is the flat one, not
vnext, and that is deliberate rather than an oversight. All three link implementations and the docs agree:internal/util/link/outbound.go:282-288emits{"address","port","id","flow","encryption"}when importing avless://link;frontend/src/lib/xray/outbound-defaults.ts:60-68seeds the flat shape for new VLESS outbounds;docs/lib/xray/outbounds.ts:3—// - VLESS uses the FLAT settings form {address,port,id,flow,encryption}.TestSubJsonServiceVlessFlattened(internal/sub/json_service_test.go:139-150) fails the build if a VLESS outbound in a JSON subscription carriesvnext;docs/content/docs/en/operations/outbounds-routing.mdx:42-43.That does not make the report wrong — the panel's own form adapter accepts
vnextfor VLESS and converts it, so the backend refusing to read the very shape the frontend tolerates is a genuine inconsistency, and the Advanced JSON editor lets that shape reach the config untouched.Verdict: Confirmed bug
Severity: Medium
Confidence: High
Root cause:
extractOutboundEndpointsininternal/web/service/outbound/outbound.go:259-260reads VLESS endpoints only fromsettings.address/settings.port. Triggered whenever a VLESS outbound's stored settings use thevnext[]shape (hand-written config, Advanced JSON editor, or an imported third-party config) and the outbound is probed in TCP mode. Introduced by8834e5fb"feat(xray/outbounds): TCP probe mode + Test All + timing breakdown" (2026-05-11), the commit that added the extractor.Already fixed: Still present on the default branch (
f727d04f, v3.7.0). First shipped in v3.0.1 (git tag --contains 8834e5fb); no later commit touches thecase "vless":arm —git log -S 'case "vless":' -- internal/web/service/outbound/outbound.goreturns only the41645255file move.Duplicate of: None. #5860 ("Freedom ping test in the outbound section") is a different root cause —
freedomis excluded deliberately atoutbound.go:159.Evidence:
internal/web/service/outbound/outbound.go:259-260case "vless": addServer(settings["address"], settings["port"]);outbound.go:164-166returns"No testable endpoint";outbound.go:246if host != "" && p > 0;probe_http.go:171if mode == "tcp" && !outboundTransportIsUDP(ob);OutboundsTab.tsx:125default'tcp';outbound-form-adapter.ts:122-131(readsvnext) and:507-514(vlessToWireemits flat);docs/lib/xray/outbounds.ts:3;internal/sub/json_service_test.go:139-150. No test currently pinsextractOutboundEndpoints—grep -rn extractOutboundEndpointsmatches onlyoutbound.go, so nothing defends the current behaviour.Not determined: Whether xray-core v26.6.27 still parses
vnextfor VLESS outbounds — the module source is outside this checkout, so I could not confirm your statement that traffic flows through the outbound normally. If it does not, the config is silently inert and the panel is right to find no endpoint; runningxray -test -config <generated config>on the server would settle it in one command.Suggested fix: extend the
case "vless":arm inextractOutboundEndpointsto readsettings.vnext[]before falling back to the flataddress/port, which is what the frontend adapter already does. The symmetric gap is worth the same one-line treatment while the file is open: thevmessarm reads onlyvnextand misses the flat shape (the shape the panel's own JSON subscriptions emit —TestSubJsonServiceVmessFlattened,internal/sub/json_service_test.go:162-172), andtrojan/shadowsocks/http/socksread onlyservers[]. A table-driven test overextractOutboundEndpointswould pin all of them at once.There is also a matching frontend gap in the outbounds table itself:
outboundAddressesreads VLESS flat-only atfrontend/src/pages/xray/outbounds/outbounds-tab-helpers.ts:33-34, so avnext-shaped VLESS row renders its address column as a bare:.This reply was generated automatically; a maintainer may follow up.