[PR #6581] [CLOSED] fix(sub): keep VLESS encryption on merged external Clash nodes #6362

Closed
opened 2026-11-02 04:08:14 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/6581
Author: @sdhfsl
Created: 9/17/2026
Status: ❌ Closed

Base: main ← Head: fix-external-vless-encryption


📝 Commits (6)

  • 959e6fd fix(panel): accept 2FA codes from adjacent TOTP windows
  • f3096bb fix(panel): share TOTP skew tolerance with VerifyTwoFactorCode
  • 198ac75 Merge branch 'main' into main
  • acb0297 Merge branch 'MHSanaei:main' into main
  • 35b92a1 Merge branch 'MHSanaei:main' into main
  • 37da44f fix(sub): keep VLESS encryption on merged external Clash nodes

📊 Changes

2 files changed (+43 additions, -0 deletions)

View changed files

📝 internal/sub/clash_external.go (+6 -0)
➕ internal/sub/clash_external_vless_test.go (+37 -0)

📄 Description

Problem

Fixes #6572.

A VLESS node with VLESS Encryption works in its standalone subscription but times out once merged into another client's subscription as an external link: the merged Clash entry loses its encryption field.

Root cause

Share-link parsing keeps the field (link/outbound.go puts encryption into settings), and the inbound Clash path emits it (clash_service.go:439). But the external-link path (clashProxyFromExternal vless branch) only copied uuid/flow and dropped encryption — the one path that renders merged nodes.

Fix

Apply the same non-empty, non-none gate as the inbound path. One branch, no behaviour change for links without encryption.

Tests

New TestClashProxyFromExternalVlessKeepsEncryption (issue shape: REALITY + mlkem768 native) and ...OmitsEmptyEncryption. Mutation-checked (field copy removed -> good test fails with encryption = <nil>, restored -> green). Full internal/sub suite passes, go vet + gofmt clean.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/MHSanaei/3x-ui/pull/6581 **Author:** [@sdhfsl](https://github.com/sdhfsl) **Created:** 9/17/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix-external-vless-encryption` --- ### 📝 Commits (6) - [`959e6fd`](https://github.com/MHSanaei/3x-ui/commit/959e6fd62b07efd1038d70ecc18c3bc59ce2e3c2) fix(panel): accept 2FA codes from adjacent TOTP windows - [`f3096bb`](https://github.com/MHSanaei/3x-ui/commit/f3096bb3c1e3091647101d80939da52ab054b21d) fix(panel): share TOTP skew tolerance with VerifyTwoFactorCode - [`198ac75`](https://github.com/MHSanaei/3x-ui/commit/198ac751d71b3b063a61b59efed80d50444febbf) Merge branch 'main' into main - [`acb0297`](https://github.com/MHSanaei/3x-ui/commit/acb0297c9b95da9d4157e751fe2789e851b34746) Merge branch 'MHSanaei:main' into main - [`35b92a1`](https://github.com/MHSanaei/3x-ui/commit/35b92a16d3770ee1c0351a1f5db75b635788fa32) Merge branch 'MHSanaei:main' into main - [`37da44f`](https://github.com/MHSanaei/3x-ui/commit/37da44f2553f81b530b98c7d2e71d8bc47f16963) fix(sub): keep VLESS encryption on merged external Clash nodes ### 📊 Changes **2 files changed** (+43 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `internal/sub/clash_external.go` (+6 -0) ➕ `internal/sub/clash_external_vless_test.go` (+37 -0) </details> ### 📄 Description ## Problem Fixes #6572. A VLESS node with VLESS Encryption works in its standalone subscription but times out once merged into another client's subscription as an external link: the merged Clash entry loses its `encryption` field. ## Root cause Share-link parsing keeps the field (`link/outbound.go` puts `encryption` into settings), and the inbound Clash path emits it (`clash_service.go:439`). But the external-link path (`clashProxyFromExternal` vless branch) only copied uuid/flow and dropped `encryption` — the one path that renders merged nodes. ## Fix Apply the same non-empty, non-`none` gate as the inbound path. One branch, no behaviour change for links without encryption. ## Tests New `TestClashProxyFromExternalVlessKeepsEncryption` (issue shape: REALITY + mlkem768 native) and `...OmitsEmptyEncryption`. Mutation-checked (field copy removed -> good test fails with `encryption = <nil>`, restored -> green). Full `internal/sub` suite passes, `go vet` + gofmt clean. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:08:14 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#6362
No description provided.