mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #6787] [MERGED] fix(panel): default TLS ALPN to http/1.1 for WebSocket transport #6454
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#6454
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?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/6787
Author: @HappyLeslieAlexander
Created: 10/10/2026
Status: ✅ Merged
Merged: 10/11/2026
Merged by: @MHSanaei
Base:
main← Head:fix/ws-tls-alpn-6782📝 Commits (3)
ba4aafcfix(panel): default TLS ALPN to http/1.1 for WebSocket transportf5187eestyle(frontend): keep comments within the two-line limit685cd0bstyle(frontend): keep comments within the two-line limit📊 Changes
4 files changed (+35 additions, -3 deletions)
View changed files
📝
frontend/src/lib/xray/inbound-tls-defaults.ts(+6 -1)📝
frontend/src/pages/inbounds/form/InboundFormModal.tsx(+6 -0)📝
frontend/src/pages/inbounds/form/useSecurityActions.ts(+2 -1)📝
frontend/src/test/inbound-defaults.test.ts(+21 -1)📄 Description
Summary
New TLS inbounds whose transport is WebSocket now default ALPN to
['http/1.1']instead of['h2', 'http/1.1']— both when switching Security to TLS and when switching the transport to WebSocket while TLS is already on.Why
Closes #6782. With the old default the panel wrote
alpn=h2,http/1.1into the Xray server config, the share links and the JSON subscriptions. Recent Xray-core clients offer exactly that ALPN (kept verbatim for camouflage inWebsocketHandshakeContext), the server negotiatesh2, and the WebSocket handshake then fails withwebsocket: protocol "h2" was given but is not supported.I verified this end-to-end with Xray-core v26.10.10 (VLESS + WS + TLS, self-signed certificate): ALPN
h2,http/1.1fails the handshake whilehttp/1.1alone works, andopenssl s_clientconfirms the server negotiatesh2when offered. This follows the existing precedent from #4076, which pins ALPN toh3when switching to the Hysteria protocol.Type of change
Areas affected
How was this tested?
h2,http/1.1→ handshake fails;http/1.1→ works).createTlsSettingsWithDefaultCert(network):wsyields['http/1.1'], every other transport (and no argument) keeps the schema default['h2','http/1.1'], plus a Zod round-trip asserting the overridden value still satisfiesTlsStreamSettingsSchema.Screenshots / recordings
N/A — form default change only; the ALPN field simply comes up with
http/1.1for new WebSocket+TLS inbounds.Breaking changes
None. Only the default for newly created/changed selections is affected; existing inbounds keep their stored ALPN.
Checklist
go build ./...and the test suite pass locally. (frontend-only change; Go code untouched)npm run lint,npm run typecheck, andnpm run buildpass. (could not run the Node toolchain in this environment; leaving verification to CI)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.