mirror of
https://github.com/alireza0/x-ui.git
synced 2026-03-21 16:25:49 +00:00
@@ -79,6 +79,12 @@ const SNIFFING_OPTION = {
|
||||
FAKEDNS: "fakedns"
|
||||
};
|
||||
|
||||
const MODE_OPTION = {
|
||||
AUTO: "auto",
|
||||
PACKET_UP: "packet-up",
|
||||
STREAM_UP: "stream-up",
|
||||
};
|
||||
|
||||
Object.freeze(Protocols);
|
||||
Object.freeze(SSMethods);
|
||||
Object.freeze(TLS_FLOW_CONTROL);
|
||||
@@ -87,6 +93,8 @@ Object.freeze(TLS_CIPHER_OPTION);
|
||||
Object.freeze(UTLS_FINGERPRINT);
|
||||
Object.freeze(ALPN_OPTION);
|
||||
Object.freeze(SNIFFING_OPTION);
|
||||
Object.freeze(MODE_OPTION);
|
||||
|
||||
|
||||
class XrayCommonClass {
|
||||
|
||||
@@ -463,7 +471,8 @@ class SplitHTTPStreamSettings extends XrayCommonClass {
|
||||
maxConnections: 0,
|
||||
cMaxReuseTimes: "64-128",
|
||||
cMaxLifetimeMs: 0
|
||||
}
|
||||
},
|
||||
mode = MODE_OPTION.AUTO,
|
||||
) {
|
||||
super();
|
||||
this.path = path;
|
||||
@@ -474,7 +483,8 @@ class SplitHTTPStreamSettings extends XrayCommonClass {
|
||||
this.scMinPostsIntervalMs = scMinPostsIntervalMs;
|
||||
this.noSSEHeader = noSSEHeader;
|
||||
this.xPaddingBytes = xPaddingBytes;
|
||||
this.xmux = xmux;
|
||||
this.xmux = xmux;
|
||||
this.mode = mode;
|
||||
}
|
||||
|
||||
addHeader(name, value) {
|
||||
@@ -496,6 +506,7 @@ class SplitHTTPStreamSettings extends XrayCommonClass {
|
||||
json.noSSEHeader,
|
||||
json.xPaddingBytes,
|
||||
json.xmux,
|
||||
json.mode,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -514,7 +525,8 @@ class SplitHTTPStreamSettings extends XrayCommonClass {
|
||||
maxConnections: this.xmux.maxConnections,
|
||||
cMaxReuseTimes: this.xmux.cMaxReuseTimes,
|
||||
cMaxLifetimeMs: this.xmux.cMaxLifetimeMs
|
||||
}
|
||||
},
|
||||
mode: this.mode,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1065,7 +1077,7 @@ class Inbound extends XrayCommonClass {
|
||||
|
||||
canEnableReality() {
|
||||
if(![Protocols.VLESS, Protocols.TROJAN].includes(this.protocol)) return false;
|
||||
return ["tcp", "http", "grpc"].includes(this.network);
|
||||
return ["tcp", "http", "grpc", "splithttp"].includes(this.network);
|
||||
}
|
||||
|
||||
canEnableStream() {
|
||||
@@ -1133,6 +1145,7 @@ class Inbound extends XrayCommonClass {
|
||||
const splithttp = this.stream.splithttp;
|
||||
obj.path = splithttp.path;
|
||||
obj.host = splithttp.host?.length>0 ? splithttp.host : this.getHeader(splithttp, 'host');
|
||||
obj.mode = splithttp.mode;
|
||||
}
|
||||
|
||||
if (security === 'tls') {
|
||||
@@ -1205,6 +1218,7 @@ class Inbound extends XrayCommonClass {
|
||||
const splithttp = this.stream.splithttp;
|
||||
params.set("path", splithttp.path);
|
||||
params.set("host", splithttp.host?.length>0 ? splithttp.host : this.getHeader(splithttp, 'host'));
|
||||
params.set("mode", splithttp.mode);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1308,6 +1322,7 @@ class Inbound extends XrayCommonClass {
|
||||
const splithttp = this.stream.splithttp;
|
||||
params.set("path", splithttp.path);
|
||||
params.set("host", splithttp.host?.length>0 ? splithttp.host : this.getHeader(splithttp, 'host'));
|
||||
params.set("mode", splithttp.mode);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1390,6 +1405,7 @@ class Inbound extends XrayCommonClass {
|
||||
const splithttp = this.stream.splithttp;
|
||||
params.set("path", splithttp.path);
|
||||
params.set("host", splithttp.host?.length>0 ? splithttp.host : this.getHeader(splithttp, 'host'));
|
||||
params.set("mode", splithttp.mode);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user