mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-06-05 20:54:14 +00:00
✨ Add previous changes into React version of app
This commit is contained in:
parent
c694fc9369
commit
d07f20c7f4
1 changed files with 50 additions and 22 deletions
|
|
@ -319,6 +319,9 @@ export default function InboundFormModal({
|
||||||
dest: window.location.hostname,
|
dest: window.location.hostname,
|
||||||
port: ib.port,
|
port: ib.port,
|
||||||
remark: '',
|
remark: '',
|
||||||
|
sni: '',
|
||||||
|
fingerprint: '',
|
||||||
|
alpn: [],
|
||||||
}];
|
}];
|
||||||
} else {
|
} else {
|
||||||
ib.stream.externalProxy = [];
|
ib.stream.externalProxy = [];
|
||||||
|
|
@ -1617,6 +1620,14 @@ export default function InboundFormModal({
|
||||||
)}
|
)}
|
||||||
<Form.Item label="Server Max Header Bytes"><InputNumber value={ib.stream.xhttp.serverMaxHeaderBytes} min={0} placeholder="0 (default)" onChange={(v) => { ib.stream.xhttp.serverMaxHeaderBytes = Number(v) || 0; refresh(); }} /></Form.Item>
|
<Form.Item label="Server Max Header Bytes"><InputNumber value={ib.stream.xhttp.serverMaxHeaderBytes} min={0} placeholder="0 (default)" onChange={(v) => { ib.stream.xhttp.serverMaxHeaderBytes = Number(v) || 0; refresh(); }} /></Form.Item>
|
||||||
<Form.Item label="Padding Bytes"><Input value={ib.stream.xhttp.xPaddingBytes} onChange={(e) => { ib.stream.xhttp.xPaddingBytes = e.target.value; refresh(); }} /></Form.Item>
|
<Form.Item label="Padding Bytes"><Input value={ib.stream.xhttp.xPaddingBytes} onChange={(e) => { ib.stream.xhttp.xPaddingBytes = e.target.value; refresh(); }} /></Form.Item>
|
||||||
|
<Form.Item label="Uplink HTTP Method">
|
||||||
|
<Select value={ib.stream.xhttp.uplinkHTTPMethod || ''} onChange={(v) => { ib.stream.xhttp.uplinkHTTPMethod = v; refresh(); }}>
|
||||||
|
<Select.Option value="">Default (POST)</Select.Option>
|
||||||
|
<Select.Option value="POST">POST</Select.Option>
|
||||||
|
<Select.Option value="PUT">PUT</Select.Option>
|
||||||
|
<Select.Option value="GET" disabled={ib.stream.xhttp.mode !== 'packet-up'}>GET (packet-up only)</Select.Option>
|
||||||
|
</Select>
|
||||||
|
</Form.Item>
|
||||||
<Form.Item label="Padding Obfs Mode"><Switch checked={!!ib.stream.xhttp.xPaddingObfsMode} onChange={(v) => { ib.stream.xhttp.xPaddingObfsMode = v; refresh(); }} /></Form.Item>
|
<Form.Item label="Padding Obfs Mode"><Switch checked={!!ib.stream.xhttp.xPaddingObfsMode} onChange={(v) => { ib.stream.xhttp.xPaddingObfsMode = v; refresh(); }} /></Form.Item>
|
||||||
{ib.stream.xhttp.xPaddingObfsMode && (
|
{ib.stream.xhttp.xPaddingObfsMode && (
|
||||||
<>
|
<>
|
||||||
|
|
@ -1686,34 +1697,51 @@ export default function InboundFormModal({
|
||||||
<Switch checked={externalProxyOn} onChange={setExternalProxy} />
|
<Switch checked={externalProxyOn} onChange={setExternalProxy} />
|
||||||
{externalProxyOn && (
|
{externalProxyOn && (
|
||||||
<Button size="small" type="primary" style={{ marginLeft: 10 }}
|
<Button size="small" type="primary" style={{ marginLeft: 10 }}
|
||||||
onClick={() => { ib.stream.externalProxy.push({ forceTls: 'same', dest: '', port: 443, remark: '' }); refresh(); }}>
|
onClick={() => { ib.stream.externalProxy.push({ forceTls: 'same', dest: '', port: 443, remark: '', sni: '', fingerprint: '', alpn: [] }); refresh(); }}>
|
||||||
<PlusOutlined />
|
<PlusOutlined />
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
{externalProxyOn && (
|
{externalProxyOn && (
|
||||||
<Form.Item wrapperCol={{ span: 24 }}>
|
<Form.Item wrapperCol={{ span: 24 }}>
|
||||||
{(ib.stream.externalProxy as { forceTls: string; dest: string; port: number; remark: string }[]).map((row, idx) => (
|
{(ib.stream.externalProxy as { forceTls: string; dest: string; port: number; remark: string; sni?: string; fingerprint?: string; alpn?: string[] }[]).map((row, idx) => (
|
||||||
<Space.Compact key={`ep-${idx}`} style={{ margin: '8px 0' }} block>
|
<div key={`ep-${idx}`} style={{ margin: '8px 0' }}>
|
||||||
<Tooltip title="Force TLS">
|
<Space.Compact block>
|
||||||
<Select value={row.forceTls} style={{ width: '20%' }} onChange={(v) => { row.forceTls = v; refresh(); }}>
|
<Tooltip title="Force TLS">
|
||||||
<Select.Option value="same">{t('pages.inbounds.same')}</Select.Option>
|
<Select value={row.forceTls} style={{ width: '20%' }} onChange={(v) => { row.forceTls = v; refresh(); }}>
|
||||||
<Select.Option value="none">{t('none')}</Select.Option>
|
<Select.Option value="same">{t('pages.inbounds.same')}</Select.Option>
|
||||||
<Select.Option value="tls">TLS</Select.Option>
|
<Select.Option value="none">{t('none')}</Select.Option>
|
||||||
</Select>
|
<Select.Option value="tls">TLS</Select.Option>
|
||||||
</Tooltip>
|
</Select>
|
||||||
<Input style={{ width: '30%' }} value={row.dest} placeholder={t('host')}
|
</Tooltip>
|
||||||
onChange={(e) => { row.dest = e.target.value; refresh(); }} />
|
<Input style={{ width: '30%' }} value={row.dest} placeholder={t('host')}
|
||||||
<Tooltip title={t('pages.inbounds.port')}>
|
onChange={(e) => { row.dest = e.target.value; refresh(); }} />
|
||||||
<InputNumber value={row.port} style={{ width: '15%' }} min={1} max={65535}
|
<Tooltip title={t('pages.inbounds.port')}>
|
||||||
onChange={(v) => { row.port = Number(v) || 0; refresh(); }} />
|
<InputNumber value={row.port} style={{ width: '15%' }} min={1} max={65535}
|
||||||
</Tooltip>
|
onChange={(v) => { row.port = Number(v) || 0; refresh(); }} />
|
||||||
<Input style={{ width: '25%' }} value={row.remark} placeholder={t('pages.inbounds.remark')}
|
</Tooltip>
|
||||||
onChange={(e) => { row.remark = e.target.value; refresh(); }} />
|
<Input style={{ width: '25%' }} value={row.remark} placeholder={t('pages.inbounds.remark')}
|
||||||
<InputAddon onClick={() => { ib.stream.externalProxy.splice(idx, 1); refresh(); }}>
|
onChange={(e) => { row.remark = e.target.value; refresh(); }} />
|
||||||
<MinusOutlined />
|
<InputAddon onClick={() => { ib.stream.externalProxy.splice(idx, 1); refresh(); }}>
|
||||||
</InputAddon>
|
<MinusOutlined />
|
||||||
</Space.Compact>
|
</InputAddon>
|
||||||
|
</Space.Compact>
|
||||||
|
{row.forceTls === 'tls' && (
|
||||||
|
<Space.Compact style={{ marginTop: 6 }} block>
|
||||||
|
<Input style={{ width: '30%' }} value={row.sni || ''} placeholder="SNI (defaults to host)"
|
||||||
|
onChange={(e) => { row.sni = e.target.value; refresh(); }} />
|
||||||
|
<Select value={row.fingerprint || ''} style={{ width: '30%' }} placeholder="Fingerprint"
|
||||||
|
onChange={(v) => { row.fingerprint = v; refresh(); }}>
|
||||||
|
<Select.Option value="">Default</Select.Option>
|
||||||
|
{FINGERPRINTS.map((fp) => <Select.Option key={fp} value={fp}>{fp}</Select.Option>)}
|
||||||
|
</Select>
|
||||||
|
<Select mode="multiple" value={row.alpn || []} style={{ width: '40%' }} placeholder="ALPN"
|
||||||
|
onChange={(v) => { row.alpn = v; refresh(); }}>
|
||||||
|
{ALPNS.map((alpn) => <Select.Option key={alpn} value={alpn}>{alpn}</Select.Option>)}
|
||||||
|
</Select>
|
||||||
|
</Space.Compact>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
))}
|
))}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue