mirror of
https://github.com/alireza0/x-ui.git
synced 2026-03-21 08:15:48 +00:00
@@ -69,12 +69,19 @@ const WireguardDomainStrategy = [
|
||||
"ForceIPv6v4"
|
||||
];
|
||||
|
||||
const MODE_OPTION = {
|
||||
AUTO: "auto",
|
||||
PACKET_UP: "packet-up",
|
||||
STREAM_UP: "stream-up",
|
||||
};
|
||||
|
||||
Object.freeze(Protocols);
|
||||
Object.freeze(SSMethods);
|
||||
Object.freeze(TLS_FLOW_CONTROL);
|
||||
Object.freeze(ALPN_OPTION);
|
||||
Object.freeze(OutboundDomainStrategies);
|
||||
Object.freeze(WireguardDomainStrategy);
|
||||
Object.freeze(MODE_OPTION);
|
||||
|
||||
class CommonClass {
|
||||
|
||||
@@ -272,16 +279,18 @@ class HttpUpgradeStreamSettings extends CommonClass {
|
||||
}
|
||||
|
||||
class SplitHTTPStreamSettings extends CommonClass {
|
||||
constructor(path='/', host='') {
|
||||
constructor(path='/', host='',mode = '') {
|
||||
super();
|
||||
this.path = path;
|
||||
this.host = host;
|
||||
this.mode = mode;
|
||||
}
|
||||
|
||||
static fromJson(json={}) {
|
||||
return new SplitHTTPStreamSettings(
|
||||
json.path,
|
||||
json.host,
|
||||
json.mode,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -289,6 +298,7 @@ class SplitHTTPStreamSettings extends CommonClass {
|
||||
return {
|
||||
path: this.path,
|
||||
host: this.host,
|
||||
mode: this.mode,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -643,7 +653,7 @@ class Outbound extends CommonClass {
|
||||
} else if (network === 'httpupgrade') {
|
||||
stream.httpupgrade = new HttpUpgradeStreamSettings(json.path,json.host);
|
||||
} else if (network === 'splithttp') {
|
||||
stream.splithttp = new SplitHTTPStreamSettings(json.path,json.host);
|
||||
stream.splithttp = new SplitHTTPStreamSettings(json.path,json.host,json.mode);
|
||||
}
|
||||
|
||||
if(json.tls && json.tls == 'tls'){
|
||||
@@ -687,7 +697,7 @@ class Outbound extends CommonClass {
|
||||
} else if (type === 'httpupgrade') {
|
||||
stream.httpupgrade = new HttpUpgradeStreamSettings(path,host);
|
||||
} else if (type === 'splithttp') {
|
||||
stream.splithttp = new SplitHTTPStreamSettings(path,host);
|
||||
stream.splithttp = new SplitHTTPStreamSettings(path,host,mode);
|
||||
}
|
||||
|
||||
if(security == 'tls'){
|
||||
|
||||
Reference in New Issue
Block a user