[PR #4064] [MERGED] Fix hysteria2 Info/QR buttons crashing on echConfigList.join #5591

Closed
opened 2026-10-31 20:48:01 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/4064
Author: @pwnnex
Created: 4/21/2026
Status: ✅ Merged
Merged: 4/21/2026
Merged by: @MHSanaei

Base: main ← Head: fix/hysteria-echconfig-join


📝 Commits (1)

  • e800076 Fix: hysteria link gen crashes when echConfigList is a string

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 web/assets/js/model/inbound.js (+1 -1)

📄 Description

Summary

Closes #4063.

Clicking Info or QR on any hysteria / hysteria2 inbound throws:

TypeError: this.stream.tls.settings.echConfigList.join is not a function
    at Inbound.genHysteriaLink (inbound.js?2.9.1:1830:122)
    at Inbound.genLink (inbound.js?2.9.1:1884:29)
    at Inbound.genAllLinks (inbound.js?2.9.1:1905:28)

Root cause

echConfigList is bound to an <a-input> (single-line string) in
web/html/form/tls_settings.html, and the TlsStreamSettings.Settings
constructor defaults it to ''. It's a string, not an array.

genHysteriaLink was the only link generator calling .join(',') on
it:

if (this.stream.tls.settings.echConfigList?.length > 0)
    params.set("ech", this.stream.tls.settings.echConfigList.join(','));

The other three link generators (genVmessLink L1608-1610,
genVlessLink L1705-1707, genTrojanLink L1781-1783) already pass the
value directly:

if (this.stream.tls.settings.echConfigList?.length > 0)
    params.set("ech", this.stream.tls.settings.echConfigList);

URLSearchParams.set stringifies arrays with , on its own, so the
same one-liner works whether the value is a string or an array.

Fix

Align genHysteriaLink with the other three: drop the .join(',')
call and pass echConfigList straight into params.set.

-        if (this.stream.tls.settings.echConfigList?.length > 0) params.set("ech", this.stream.tls.settings.echConfigList.join(','));
+        if (this.stream.tls.settings.echConfigList?.length > 0) params.set("ech", this.stream.tls.settings.echConfigList);

One line, no behaviour change for correctly-typed input.

Test plan

  • Create a hysteria2 inbound → click Info → modal renders with a
    valid hysteria2://… URI (no console exception)
  • Same for the QR button
  • Inbound with echConfigList populated still emits an ech=…
    query parameter in the generated link
  • VLESS / VMess / Trojan inbounds unaffected (those code paths
    were already correct)

🔄 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/4064 **Author:** [@pwnnex](https://github.com/pwnnex) **Created:** 4/21/2026 **Status:** ✅ Merged **Merged:** 4/21/2026 **Merged by:** [@MHSanaei](https://github.com/MHSanaei) **Base:** `main` ← **Head:** `fix/hysteria-echconfig-join` --- ### 📝 Commits (1) - [`e800076`](https://github.com/MHSanaei/3x-ui/commit/e80007668116b206112d48339c4aabf6af6b91b3) Fix: hysteria link gen crashes when echConfigList is a string ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `web/assets/js/model/inbound.js` (+1 -1) </details> ### 📄 Description ## Summary Closes #4063. Clicking **Info** or **QR** on any hysteria / hysteria2 inbound throws: ``` TypeError: this.stream.tls.settings.echConfigList.join is not a function at Inbound.genHysteriaLink (inbound.js?2.9.1:1830:122) at Inbound.genLink (inbound.js?2.9.1:1884:29) at Inbound.genAllLinks (inbound.js?2.9.1:1905:28) ``` ## Root cause `echConfigList` is bound to an `<a-input>` (single-line string) in `web/html/form/tls_settings.html`, and the `TlsStreamSettings.Settings` constructor defaults it to `''`. It's a **string**, not an array. `genHysteriaLink` was the only link generator calling `.join(',')` on it: ```js if (this.stream.tls.settings.echConfigList?.length > 0) params.set("ech", this.stream.tls.settings.echConfigList.join(',')); ``` The other three link generators (`genVmessLink` L1608-1610, `genVlessLink` L1705-1707, `genTrojanLink` L1781-1783) already pass the value directly: ```js if (this.stream.tls.settings.echConfigList?.length > 0) params.set("ech", this.stream.tls.settings.echConfigList); ``` `URLSearchParams.set` stringifies arrays with `,` on its own, so the same one-liner works whether the value is a string or an array. ## Fix Align `genHysteriaLink` with the other three: drop the `.join(',')` call and pass `echConfigList` straight into `params.set`. ```diff - if (this.stream.tls.settings.echConfigList?.length > 0) params.set("ech", this.stream.tls.settings.echConfigList.join(',')); + if (this.stream.tls.settings.echConfigList?.length > 0) params.set("ech", this.stream.tls.settings.echConfigList); ``` One line, no behaviour change for correctly-typed input. ## Test plan - [x] Create a hysteria2 inbound → click Info → modal renders with a valid `hysteria2://…` URI (no console exception) - [x] Same for the QR button - [x] Inbound with `echConfigList` populated still emits an `ech=…` query parameter in the generated link - [x] VLESS / VMess / Trojan inbounds unaffected (those code paths were already correct) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 20:48:01 +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#5591
No description provided.