From 54a2d323439d95d018095549d2343698bcc3d33d Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Tue, 26 May 2026 02:27:38 +0200 Subject: [PATCH] feat(frontend): stream tab XHTTP section (Pattern A) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit XHTTP is the heaviest network branch — 19 fields rendered conditionally on mode, xPaddingObfsMode, and the three *Placement selectors. Each gates its dependent field set via Form.useWatch. Field structure mirrors the legacy XHTTPStreamSettings form 1:1: - mode picker (auto / packet-up / stream-up / stream-one) - packet-up adds scMaxBufferedPosts + scMaxEachPostBytes; stream-up adds scStreamUpServerSecs - serverMaxHeaderBytes, xPaddingBytes, uplinkHTTPMethod (with the packet-up gate on the GET option) - xPaddingObfsMode unlocks xPadding{Key,Header,Placement,Method} - sessionPlacement / seqPlacement each unlock their respective Key field when set to anything other than 'path' - packet-up mode additionally unlocks uplinkDataPlacement, and that in turn unlocks uplinkDataKey when the placement is not 'body' - noSSEHeader Switch at the tail XHTTP headers editor still pending (same WsHeaderMap as WS — will be unified in the header-editor extraction commit). --- .../pages/inbounds/InboundFormModal.new.tsx | 188 ++++++++++++++++++ 1 file changed, 188 insertions(+) diff --git a/frontend/src/pages/inbounds/InboundFormModal.new.tsx b/frontend/src/pages/inbounds/InboundFormModal.new.tsx index dd2a7d90..35006924 100644 --- a/frontend/src/pages/inbounds/InboundFormModal.new.tsx +++ b/frontend/src/pages/inbounds/InboundFormModal.new.tsx @@ -107,6 +107,11 @@ export default function InboundFormModalNew({ const mixedUdpOn = Form.useWatch(['settings', 'udp'], form) ?? false; const network = Form.useWatch(['streamSettings', 'network'], form) ?? ''; const streamEnabled = canEnableStream({ protocol }); + const xhttpMode = Form.useWatch(['streamSettings', 'xhttpSettings', 'mode'], form); + const xhttpObfsMode = Form.useWatch(['streamSettings', 'xhttpSettings', 'xPaddingObfsMode'], form) ?? false; + const xhttpSessionPlacement = Form.useWatch(['streamSettings', 'xhttpSettings', 'sessionPlacement'], form); + const xhttpSeqPlacement = Form.useWatch(['streamSettings', 'xhttpSettings', 'seqPlacement'], form); + const xhttpUplinkPlacement = Form.useWatch(['streamSettings', 'xhttpSettings', 'uplinkDataPlacement'], form); const wgSecretKey = Form.useWatch(['settings', 'secretKey'], form); const wgPubKey = typeof wgSecretKey === 'string' && wgSecretKey.length > 0 ? Wireguard.generateKeypair(wgSecretKey).publicKey @@ -866,6 +871,189 @@ export default function InboundFormModalNew({ )} + {network === 'xhttp' && ( + <> + + + + + + + + + + {xhttpMode === 'packet-up' && ( + <> + + + + + + + + )} + {xhttpMode === 'stream-up' && ( + + + + )} + + + + + + + + + + + + + {xhttpObfsMode && ( + <> + + + + + + + + + + + + + + )} + + + + {xhttpSessionPlacement && xhttpSessionPlacement !== 'path' && ( + + + + )} + + + + {xhttpSeqPlacement && xhttpSeqPlacement !== 'path' && ( + + + + )} + {xhttpMode === 'packet-up' && ( + <> + + + + {xhttpUplinkPlacement && xhttpUplinkPlacement !== 'body' && ( + + + + )} + + )} + + + + + )} + {network === 'httpupgrade' && ( <>