mirror of
https://github.com/alireza0/x-ui.git
synced 2026-03-13 21:13:09 +00:00
XHTTP transport: New options for bypassing CDN's detection
https://github.com/XTLS/Xray-core/pull/5414 Co-authored-by: MHSanaei <ho3ein.sanaei@gmail.com>
This commit is contained in:
@@ -487,6 +487,19 @@ class xHTTPStreamSettings extends XrayCommonClass {
|
||||
noSSEHeader = false,
|
||||
xPaddingBytes = "100-1000",
|
||||
mode = MODE_OPTION.AUTO,
|
||||
xPaddingObfsMode = false,
|
||||
xPaddingKey = '',
|
||||
xPaddingHeader = '',
|
||||
xPaddingPlacement = '',
|
||||
xPaddingMethod = '',
|
||||
uplinkHTTPMethod = '',
|
||||
sessionPlacement = '',
|
||||
sessionKey = '',
|
||||
seqPlacement = '',
|
||||
seqKey = '',
|
||||
uplinkDataPlacement = '',
|
||||
uplinkDataKey = '',
|
||||
uplinkChunkSize = 0,
|
||||
) {
|
||||
super();
|
||||
this.path = path;
|
||||
@@ -498,6 +511,19 @@ class xHTTPStreamSettings extends XrayCommonClass {
|
||||
this.noSSEHeader = noSSEHeader;
|
||||
this.xPaddingBytes = xPaddingBytes;
|
||||
this.mode = mode;
|
||||
this.xPaddingObfsMode = xPaddingObfsMode;
|
||||
this.xPaddingKey = xPaddingKey;
|
||||
this.xPaddingHeader = xPaddingHeader;
|
||||
this.xPaddingPlacement = xPaddingPlacement;
|
||||
this.xPaddingMethod = xPaddingMethod;
|
||||
this.uplinkHTTPMethod = uplinkHTTPMethod;
|
||||
this.sessionPlacement = sessionPlacement;
|
||||
this.sessionKey = sessionKey;
|
||||
this.seqPlacement = seqPlacement;
|
||||
this.seqKey = seqKey;
|
||||
this.uplinkDataPlacement = uplinkDataPlacement;
|
||||
this.uplinkDataKey = uplinkDataKey;
|
||||
this.uplinkChunkSize = uplinkChunkSize;
|
||||
}
|
||||
|
||||
addHeader(name, value) {
|
||||
@@ -519,6 +545,19 @@ class xHTTPStreamSettings extends XrayCommonClass {
|
||||
json.noSSEHeader,
|
||||
json.xPaddingBytes,
|
||||
json.mode,
|
||||
json.xPaddingObfsMode,
|
||||
json.xPaddingKey,
|
||||
json.xPaddingHeader,
|
||||
json.xPaddingPlacement,
|
||||
json.xPaddingMethod,
|
||||
json.uplinkHTTPMethod,
|
||||
json.sessionPlacement,
|
||||
json.sessionKey,
|
||||
json.seqPlacement,
|
||||
json.seqKey,
|
||||
json.uplinkDataPlacement,
|
||||
json.uplinkDataKey,
|
||||
json.uplinkChunkSize,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -533,6 +572,19 @@ class xHTTPStreamSettings extends XrayCommonClass {
|
||||
noSSEHeader: this.noSSEHeader,
|
||||
xPaddingBytes: this.xPaddingBytes,
|
||||
mode: this.mode,
|
||||
xPaddingObfsMode: this.xPaddingObfsMode,
|
||||
xPaddingKey: this.xPaddingKey,
|
||||
xPaddingHeader: this.xPaddingHeader,
|
||||
xPaddingPlacement: this.xPaddingPlacement,
|
||||
xPaddingMethod: this.xPaddingMethod,
|
||||
uplinkHTTPMethod: this.uplinkHTTPMethod,
|
||||
sessionPlacement: this.sessionPlacement,
|
||||
sessionKey: this.sessionKey,
|
||||
seqPlacement: this.seqPlacement,
|
||||
seqKey: this.seqKey,
|
||||
uplinkDataPlacement: this.uplinkDataPlacement,
|
||||
uplinkDataKey: this.uplinkDataKey,
|
||||
uplinkChunkSize: this.uplinkChunkSize,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,6 +39,95 @@
|
||||
<a-form-item label="Padding Bytes">
|
||||
<a-input v-model.trim="inbound.stream.xhttp.xPaddingBytes"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label="Padding Obfs Mode">
|
||||
<a-switch v-model="inbound.stream.xhttp.xPaddingObfsMode"></a-switch>
|
||||
</a-form-item>
|
||||
<template v-if="inbound.stream.xhttp.xPaddingObfsMode">
|
||||
<a-form-item label="Padding Key">
|
||||
<a-input v-model.trim="inbound.stream.xhttp.xPaddingKey"
|
||||
placeholder="x_padding"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label="Padding Header">
|
||||
<a-input v-model.trim="inbound.stream.xhttp.xPaddingHeader"
|
||||
placeholder="X-Padding"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label="Padding Placement">
|
||||
<a-select v-model="inbound.stream.xhttp.xPaddingPlacement"
|
||||
:dropdown-class-name="themeSwitcher.currentTheme">
|
||||
<a-select-option value>Default (queryInHeader)</a-select-option>
|
||||
<a-select-option
|
||||
value="queryInHeader">queryInHeader</a-select-option>
|
||||
<a-select-option value="header">header</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item label="Padding Method">
|
||||
<a-select v-model="inbound.stream.xhttp.xPaddingMethod"
|
||||
:dropdown-class-name="themeSwitcher.currentTheme">
|
||||
<a-select-option value>Default (repeat-x)</a-select-option>
|
||||
<a-select-option value="repeat-x">repeat-x</a-select-option>
|
||||
<a-select-option value="tokenish">tokenish</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</template>
|
||||
<a-form-item label="Uplink HTTP Method">
|
||||
<a-select v-model="inbound.stream.xhttp.uplinkHTTPMethod"
|
||||
:dropdown-class-name="themeSwitcher.currentTheme">
|
||||
<a-select-option value>Default (POST)</a-select-option>
|
||||
<a-select-option value="POST">POST</a-select-option>
|
||||
<a-select-option value="PUT">PUT</a-select-option>
|
||||
<a-select-option value="GET">GET (packet-up only)</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item label="Session Placement">
|
||||
<a-select v-model="inbound.stream.xhttp.sessionPlacement"
|
||||
:dropdown-class-name="themeSwitcher.currentTheme">
|
||||
<a-select-option value>Default (path)</a-select-option>
|
||||
<a-select-option value="path">path</a-select-option>
|
||||
<a-select-option value="header">header</a-select-option>
|
||||
<a-select-option value="cookie">cookie</a-select-option>
|
||||
<a-select-option value="query">query</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item label="Session Key"
|
||||
v-if="inbound.stream.xhttp.sessionPlacement && inbound.stream.xhttp.sessionPlacement !== 'path'">
|
||||
<a-input v-model.trim="inbound.stream.xhttp.sessionKey"
|
||||
placeholder="x_session"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label="Sequence Placement">
|
||||
<a-select v-model="inbound.stream.xhttp.seqPlacement"
|
||||
:dropdown-class-name="themeSwitcher.currentTheme">
|
||||
<a-select-option value>Default (path)</a-select-option>
|
||||
<a-select-option value="path">path</a-select-option>
|
||||
<a-select-option value="header">header</a-select-option>
|
||||
<a-select-option value="cookie">cookie</a-select-option>
|
||||
<a-select-option value="query">query</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item label="Sequence Key"
|
||||
v-if="inbound.stream.xhttp.seqPlacement && inbound.stream.xhttp.seqPlacement !== 'path'">
|
||||
<a-input v-model.trim="inbound.stream.xhttp.seqKey"
|
||||
placeholder="x_seq"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label="Uplink Data Placement"
|
||||
v-if="inbound.stream.xhttp.mode === 'packet-up'">
|
||||
<a-select v-model="inbound.stream.xhttp.uplinkDataPlacement"
|
||||
:dropdown-class-name="themeSwitcher.currentTheme">
|
||||
<a-select-option value>Default (body)</a-select-option>
|
||||
<a-select-option value="body">body</a-select-option>
|
||||
<a-select-option value="header">header</a-select-option>
|
||||
<a-select-option value="query">query</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item label="Uplink Data Key"
|
||||
v-if="inbound.stream.xhttp.mode === 'packet-up' && inbound.stream.xhttp.uplinkDataPlacement && inbound.stream.xhttp.uplinkDataPlacement !== 'body'">
|
||||
<a-input v-model.trim="inbound.stream.xhttp.uplinkDataKey"
|
||||
placeholder="x_data"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label="Uplink Chunk Size"
|
||||
v-if="inbound.stream.xhttp.mode === 'packet-up' && inbound.stream.xhttp.uplinkDataPlacement && inbound.stream.xhttp.uplinkDataPlacement !== 'body'">
|
||||
<a-input-number v-model.number="inbound.stream.xhttp.uplinkChunkSize"
|
||||
:min="0" placeholder="0 (unlimited)"></a-input-number>
|
||||
</a-form-item>
|
||||
<a-form-item label="No SSE Header">
|
||||
<a-switch v-model="inbound.stream.xhttp.noSSEHeader"></a-switch>
|
||||
</a-form-item>
|
||||
|
||||
Reference in New Issue
Block a user