From 60e6b12f4c81f48498f8653634bb45cfe8cc6114 Mon Sep 17 00:00:00 2001 From: Abdalrahman Date: Wed, 13 May 2026 02:25:00 +0300 Subject: [PATCH] fix(hysteria2): restore missing masquerade config in inbound form (#4316) * fix(hysteria2): restore missing masquerade config in inbound form Fixes #4303 The Hysteria2 Masquerade option was missing from the Stream settings tab after the v3.0.0 form rewrite. Added the UI form and ensured the masquerade block is passed through in subscription JSON generation. --- frontend/src/models/inbound.js | 3 +- .../src/pages/inbounds/InboundFormModal.vue | 68 +++++++++++++++++++ sub/subJsonService.go | 3 + 3 files changed, 73 insertions(+), 1 deletion(-) diff --git a/frontend/src/models/inbound.js b/frontend/src/models/inbound.js index cccd8d4d2..f8f1738ea 100644 --- a/frontend/src/models/inbound.js +++ b/frontend/src/models/inbound.js @@ -687,8 +687,9 @@ export class HysteriaMasquerade extends XrayCommonClass { } static fromJson(json = {}) { + const type = ['proxy', 'file', 'string'].includes(json.type) ? json.type : 'proxy'; return new HysteriaMasquerade( - json.type, + type, json.dir, json.url, json.rewriteHost, diff --git a/frontend/src/pages/inbounds/InboundFormModal.vue b/frontend/src/pages/inbounds/InboundFormModal.vue index fd045bbb1..7eebd5943 100644 --- a/frontend/src/pages/inbounds/InboundFormModal.vue +++ b/frontend/src/pages/inbounds/InboundFormModal.vue @@ -1671,6 +1671,74 @@ watch( + + + + diff --git a/sub/subJsonService.go b/sub/subJsonService.go index fc35698e9..4fe77b88d 100644 --- a/sub/subJsonService.go +++ b/sub/subJsonService.go @@ -447,6 +447,9 @@ func (s *SubJsonService) genHy(inbound *model.Inbound, newStream map[string]any, if udpIdleTimeout, ok := hyStream["udpIdleTimeout"].(float64); ok { outHyStream["udpIdleTimeout"] = int(udpIdleTimeout) } + if masquerade, ok := hyStream["masquerade"].(map[string]any); ok { + outHyStream["masquerade"] = masquerade + } newStream["hysteriaSettings"] = outHyStream if finalmask, ok := hyStream["finalmask"].(map[string]any); ok {