mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-06-05 20:54:14 +00:00
fix(raw): complete the HTTP header section for inbound and outbound
Align both raw (TCP) transport forms with the Xray docs: request {version, method, path, headers} + response {version, status, reason, headers}. The outbound form was missing the request.path input, so panel-created outbounds were stuck on GET / and could not match a custom inbound path; add it with the same comma-separated array handling as the inbound. Also drop a stale inbound comment that claimed xray-core ignores the inbound request object, which contradicts both the code and the docs (request and response must match on both sides).
This commit is contained in:
parent
bcb982aeba
commit
5b6e05a0fc
2 changed files with 18 additions and 10 deletions
|
|
@ -56,13 +56,6 @@ export default function RawForm() {
|
||||||
}}
|
}}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
{/* Per Xray docs (transports/raw.html#httpheaderobject), the
|
|
||||||
`request` object is honored only by outbound proxies; the
|
|
||||||
inbound listener reads `response`. Showing Host / Path /
|
|
||||||
Method / Version / request-headers on the inbound side was
|
|
||||||
a regression from this modal's earlier iteration — those
|
|
||||||
inputs wrote to the wire but xray-core ignored them. The
|
|
||||||
inbound modal now only exposes the response side. */}
|
|
||||||
<Form.Item
|
<Form.Item
|
||||||
noStyle
|
noStyle
|
||||||
shouldUpdate={(prev, curr) =>
|
shouldUpdate={(prev, curr) =>
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,15 @@ export default function RawForm({ form }: { form: FormInstance<OutboundFormValue
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
{type === 'http' && (
|
{type === 'http' && (
|
||||||
<>
|
<>
|
||||||
|
<Form.Item
|
||||||
|
label={t('pages.inbounds.form.requestVersion')}
|
||||||
|
name={[
|
||||||
|
'streamSettings', 'tcpSettings', 'header',
|
||||||
|
'request', 'version',
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<Input placeholder="1.1" />
|
||||||
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t('pages.inbounds.form.requestMethod')}
|
label={t('pages.inbounds.form.requestMethod')}
|
||||||
name={[
|
name={[
|
||||||
|
|
@ -57,13 +66,19 @@ export default function RawForm({ form }: { form: FormInstance<OutboundFormValue
|
||||||
<Input placeholder="GET" />
|
<Input placeholder="GET" />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t('pages.inbounds.form.requestVersion')}
|
label={t('pages.inbounds.form.requestPath')}
|
||||||
name={[
|
name={[
|
||||||
'streamSettings', 'tcpSettings', 'header',
|
'streamSettings', 'tcpSettings', 'header',
|
||||||
'request', 'version',
|
'request', 'path',
|
||||||
]}
|
]}
|
||||||
|
getValueProps={(v) => ({ value: Array.isArray(v) ? v.join(',') : v })}
|
||||||
|
getValueFromEvent={(e) => {
|
||||||
|
const raw = (e?.target?.value ?? '') as string;
|
||||||
|
const parts = raw.split(',').map((s) => s.trim()).filter(Boolean);
|
||||||
|
return parts.length > 0 ? parts : ['/'];
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<Input placeholder="1.1" />
|
<Input placeholder="/" />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t('pages.inbounds.form.requestHeaders')}
|
label={t('pages.inbounds.form.requestHeaders')}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue