mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5473] [Bug]: No ALPN set in subscriptions / client outputs #3826
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#3826
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 @arashvenus70 on GitHub (Jun 21, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5473
Describe the bug
Version: 3.3.1
Configurations affected: vless xhttp-tls / ws-tls
How to reproduce the problem
Alternatively,
5. Copy v2ray configuration text
6. No ALPN set in output
Expected behavior
ALPN set in subscription page
ALPN set in v2ray configuration text
Actual behavior
No ALPN set in client subscription page / configuration output
Relevant logs
Screenshots
3x-ui version
3.3.1
Xray-core version
No response
How did you install 3x-ui?
install.sh script
Operating system
Ubuntu 26
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 21, 2026):
Traced this through both output paths. The subscription service and the panel share link generator both handle ALPN correctly — but only when
tlsSettings.alpnin the storedstreamSettingsJSON is a non-empty array. The bug is almost certainly upstream of the link generators: the ALPN values are not reaching the database.What the code does
applyShareTLSParams(internal/sub/service.go, around line 1101) readsstream["tlsSettings"]["alpn"].([]any), joins with a comma, and setsparams["alpn"]— but only if the resulting slice is non-empty. This function is transport-agnostic; the same code path is reached whether the network istcp,ws, orxhttp. The frontend panel link generator (frontend/src/lib/xray/inbound-link.ts,genVlessLink) always setsalpn=tls.alpn.join(',')whensecurity === 'tls', regardless of transport, so an empty array there producesalpn=(empty string) rather than omitting the param entirely.Both paths produce correct output when the stored JSON contains
"alpn": ["h2","http/1.1"]. Both produce no useful ALPN output when it contains"alpn": []or noalpnkey at all.Coverage gap
Every existing test fixture that uses
xhttp+TLS orws+TLS omitsalpnfrom thetlsSettingsobject (seejson_service_test.golines 183 and 229,host_sub_test.goline 57). A regression specific to xhttp+TLS+ALPN or ws+TLS+ALPN in the link generators would not be caught by the current test suite.Diagnostics needed
To confirm where the value is lost, please provide:
The raw
stream_settingsJSON stored for an affected inbound. On a SQLite installation:sqlite3 /etc/x-ui/x-ui.db "SELECT stream_settings FROM inbounds WHERE id = <id>;". On PostgreSQL, the equivalentSELECT. Look for thetlsSettings.alpnarray — if it is[]or absent, the form submission is not persisting the selected values.Whether the inbound was newly created on v3.3.1 or migrated/imported from an older version. Legacy inbounds may not have
alpnin their stored JSON at all.A verbatim copy of one subscription URL (or panel share link) from an affected inbound, so we can confirm whether
alpnis absent entirely or present as an empty string.If the stored JSON shows
"alpn": ["h2","http/1.1"](or whichever values were selected) but the subscription URL still lacks it, that would point to the link generator and the characterization test gap above becomes the focus for a fix.I'm an automated triage assistant. A maintainer will follow up.
@arashvenus70 commented on GitHub (Jun 21, 2026):
Upon double checking, it seems the problem is on the client side.
ALPN is fully present in config output text & subscription page.