mirror of
https://github.com/alireza0/x-ui.git
synced 2026-03-14 05:23:09 +00:00
new - splithttp
inbound outbound
This commit is contained in:
@@ -223,8 +223,9 @@ func (s *SubJsonService) streamData(stream string) map[string]interface{} {
|
|||||||
streamSettings["wsSettings"] = s.removeAcceptProxy(streamSettings["wsSettings"])
|
streamSettings["wsSettings"] = s.removeAcceptProxy(streamSettings["wsSettings"])
|
||||||
case "httpupgrade":
|
case "httpupgrade":
|
||||||
streamSettings["httpupgradeSettings"] = s.removeAcceptProxy(streamSettings["httpupgradeSettings"])
|
streamSettings["httpupgradeSettings"] = s.removeAcceptProxy(streamSettings["httpupgradeSettings"])
|
||||||
|
case "splithttp":
|
||||||
|
streamSettings["splithttpSettings"] = s.removeAcceptProxy(streamSettings["splithttpSettings"])
|
||||||
}
|
}
|
||||||
|
|
||||||
return streamSettings
|
return streamSettings
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -221,7 +221,21 @@ func (s *SubService) genVmessLink(inbound *model.Inbound, email string) string {
|
|||||||
case "httpupgrade":
|
case "httpupgrade":
|
||||||
httpupgrade, _ := stream["httpupgradeSettings"].(map[string]interface{})
|
httpupgrade, _ := stream["httpupgradeSettings"].(map[string]interface{})
|
||||||
obj["path"] = httpupgrade["path"].(string)
|
obj["path"] = httpupgrade["path"].(string)
|
||||||
obj["host"] = httpupgrade["host"].(string)
|
if host, ok := httpupgrade["host"].(string); ok && len(host) > 0 {
|
||||||
|
obj["host"] = host
|
||||||
|
} else {
|
||||||
|
headers, _ := httpupgrade["headers"].(map[string]interface{})
|
||||||
|
obj["host"] = searchHost(headers)
|
||||||
|
}
|
||||||
|
case "splithttp":
|
||||||
|
splithttp, _ := stream["splithttpSettings"].(map[string]interface{})
|
||||||
|
obj["path"] = splithttp["path"].(string)
|
||||||
|
if host, ok := splithttp["host"].(string); ok && len(host) > 0 {
|
||||||
|
obj["host"] = host
|
||||||
|
} else {
|
||||||
|
headers, _ := splithttp["headers"].(map[string]interface{})
|
||||||
|
obj["host"] = searchHost(headers)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
security, _ := stream["security"].(string)
|
security, _ := stream["security"].(string)
|
||||||
@@ -364,9 +378,22 @@ func (s *SubService) genVlessLink(inbound *model.Inbound, email string) string {
|
|||||||
case "httpupgrade":
|
case "httpupgrade":
|
||||||
httpupgrade, _ := stream["httpupgradeSettings"].(map[string]interface{})
|
httpupgrade, _ := stream["httpupgradeSettings"].(map[string]interface{})
|
||||||
params["path"] = httpupgrade["path"].(string)
|
params["path"] = httpupgrade["path"].(string)
|
||||||
params["host"] = httpupgrade["host"].(string)
|
if host, ok := httpupgrade["host"].(string); ok && len(host) > 0 {
|
||||||
|
params["host"] = host
|
||||||
|
} else {
|
||||||
|
headers, _ := httpupgrade["headers"].(map[string]interface{})
|
||||||
|
params["host"] = searchHost(headers)
|
||||||
|
}
|
||||||
|
case "splithttp":
|
||||||
|
splithttp, _ := stream["splithttpSettings"].(map[string]interface{})
|
||||||
|
params["path"] = splithttp["path"].(string)
|
||||||
|
if host, ok := splithttp["host"].(string); ok && len(host) > 0 {
|
||||||
|
params["host"] = host
|
||||||
|
} else {
|
||||||
|
headers, _ := splithttp["headers"].(map[string]interface{})
|
||||||
|
params["host"] = searchHost(headers)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
security, _ := stream["security"].(string)
|
security, _ := stream["security"].(string)
|
||||||
if security == "tls" {
|
if security == "tls" {
|
||||||
params["security"] = "tls"
|
params["security"] = "tls"
|
||||||
@@ -554,9 +581,22 @@ func (s *SubService) genTrojanLink(inbound *model.Inbound, email string) string
|
|||||||
case "httpupgrade":
|
case "httpupgrade":
|
||||||
httpupgrade, _ := stream["httpupgradeSettings"].(map[string]interface{})
|
httpupgrade, _ := stream["httpupgradeSettings"].(map[string]interface{})
|
||||||
params["path"] = httpupgrade["path"].(string)
|
params["path"] = httpupgrade["path"].(string)
|
||||||
params["host"] = httpupgrade["host"].(string)
|
if host, ok := httpupgrade["host"].(string); ok && len(host) > 0 {
|
||||||
|
params["host"] = host
|
||||||
|
} else {
|
||||||
|
headers, _ := httpupgrade["headers"].(map[string]interface{})
|
||||||
|
params["host"] = searchHost(headers)
|
||||||
|
}
|
||||||
|
case "splithttp":
|
||||||
|
splithttp, _ := stream["splithttpSettings"].(map[string]interface{})
|
||||||
|
params["path"] = splithttp["path"].(string)
|
||||||
|
if host, ok := splithttp["host"].(string); ok && len(host) > 0 {
|
||||||
|
params["host"] = host
|
||||||
|
} else {
|
||||||
|
headers, _ := splithttp["headers"].(map[string]interface{})
|
||||||
|
params["host"] = searchHost(headers)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
security, _ := stream["security"].(string)
|
security, _ := stream["security"].(string)
|
||||||
if security == "tls" {
|
if security == "tls" {
|
||||||
params["security"] = "tls"
|
params["security"] = "tls"
|
||||||
@@ -740,7 +780,21 @@ func (s *SubService) genShadowsocksLink(inbound *model.Inbound, email string) st
|
|||||||
case "httpupgrade":
|
case "httpupgrade":
|
||||||
httpupgrade, _ := stream["httpupgradeSettings"].(map[string]interface{})
|
httpupgrade, _ := stream["httpupgradeSettings"].(map[string]interface{})
|
||||||
params["path"] = httpupgrade["path"].(string)
|
params["path"] = httpupgrade["path"].(string)
|
||||||
params["host"] = httpupgrade["host"].(string)
|
if host, ok := httpupgrade["host"].(string); ok && len(host) > 0 {
|
||||||
|
params["host"] = host
|
||||||
|
} else {
|
||||||
|
headers, _ := httpupgrade["headers"].(map[string]interface{})
|
||||||
|
params["host"] = searchHost(headers)
|
||||||
|
}
|
||||||
|
case "splithttp":
|
||||||
|
splithttp, _ := stream["splithttpSettings"].(map[string]interface{})
|
||||||
|
params["path"] = splithttp["path"].(string)
|
||||||
|
if host, ok := splithttp["host"].(string); ok && len(host) > 0 {
|
||||||
|
params["host"] = host
|
||||||
|
} else {
|
||||||
|
headers, _ := splithttp["headers"].(map[string]interface{})
|
||||||
|
params["host"] = searchHost(headers)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
security, _ := stream["security"].(string)
|
security, _ := stream["security"].(string)
|
||||||
|
|||||||
@@ -299,6 +299,28 @@ class HttpUpgradeStreamSettings extends CommonClass {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class SplitHTTPStreamSettings extends CommonClass {
|
||||||
|
constructor(path='/', host='') {
|
||||||
|
super();
|
||||||
|
this.path = path;
|
||||||
|
this.host = host;
|
||||||
|
}
|
||||||
|
|
||||||
|
static fromJson(json={}) {
|
||||||
|
return new SplitHTTPStreamSettings(
|
||||||
|
json.path,
|
||||||
|
json.host,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
toJson() {
|
||||||
|
return {
|
||||||
|
path: this.path,
|
||||||
|
host: this.host,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class TlsStreamSettings extends CommonClass {
|
class TlsStreamSettings extends CommonClass {
|
||||||
constructor(serverName='',
|
constructor(serverName='',
|
||||||
alpn=[],
|
alpn=[],
|
||||||
@@ -357,7 +379,7 @@ class RealityStreamSettings extends CommonClass {
|
|||||||
spiderX: this.spiderX,
|
spiderX: this.spiderX,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
class SockoptStreamSettings extends CommonClass {
|
class SockoptStreamSettings extends CommonClass {
|
||||||
constructor(dialerProxy = "", tcpFastOpen = false, tcpKeepAliveInterval = 0, tcpNoDelay = false) {
|
constructor(dialerProxy = "", tcpFastOpen = false, tcpKeepAliveInterval = 0, tcpNoDelay = false) {
|
||||||
@@ -400,6 +422,7 @@ class StreamSettings extends CommonClass {
|
|||||||
quicSettings=new QuicStreamSettings(),
|
quicSettings=new QuicStreamSettings(),
|
||||||
grpcSettings=new GrpcStreamSettings(),
|
grpcSettings=new GrpcStreamSettings(),
|
||||||
httpupgradeSettings=new HttpUpgradeStreamSettings(),
|
httpupgradeSettings=new HttpUpgradeStreamSettings(),
|
||||||
|
splithttpSettings=new SplitHTTPStreamSettings(),
|
||||||
sockopt = undefined,
|
sockopt = undefined,
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
@@ -414,6 +437,7 @@ class StreamSettings extends CommonClass {
|
|||||||
this.quic = quicSettings;
|
this.quic = quicSettings;
|
||||||
this.grpc = grpcSettings;
|
this.grpc = grpcSettings;
|
||||||
this.httpupgrade = httpupgradeSettings;
|
this.httpupgrade = httpupgradeSettings;
|
||||||
|
this.splithttp = splithttpSettings;
|
||||||
this.sockopt = sockopt;
|
this.sockopt = sockopt;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -446,6 +470,7 @@ class StreamSettings extends CommonClass {
|
|||||||
QuicStreamSettings.fromJson(json.quicSettings),
|
QuicStreamSettings.fromJson(json.quicSettings),
|
||||||
GrpcStreamSettings.fromJson(json.grpcSettings),
|
GrpcStreamSettings.fromJson(json.grpcSettings),
|
||||||
HttpUpgradeStreamSettings.fromJson(json.httpupgradeSettings),
|
HttpUpgradeStreamSettings.fromJson(json.httpupgradeSettings),
|
||||||
|
SplitHTTPStreamSettings.fromJson(json.splithttpSettings),
|
||||||
SockoptStreamSettings.fromJson(json.sockopt),
|
SockoptStreamSettings.fromJson(json.sockopt),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -464,6 +489,7 @@ class StreamSettings extends CommonClass {
|
|||||||
quicSettings: network === 'quic' ? this.quic.toJson() : undefined,
|
quicSettings: network === 'quic' ? this.quic.toJson() : undefined,
|
||||||
grpcSettings: network === 'grpc' ? this.grpc.toJson() : undefined,
|
grpcSettings: network === 'grpc' ? this.grpc.toJson() : undefined,
|
||||||
httpupgradeSettings: network === 'httpupgrade' ? this.httpupgrade.toJson() : undefined,
|
httpupgradeSettings: network === 'httpupgrade' ? this.httpupgrade.toJson() : undefined,
|
||||||
|
splithttpSettings: network === 'splithttp' ? this.splithttp.toJson() : undefined,
|
||||||
sockopt: this.sockopt != undefined ? this.sockopt.toJson() : undefined,
|
sockopt: this.sockopt != undefined ? this.sockopt.toJson() : undefined,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -528,7 +554,7 @@ class Outbound extends CommonClass {
|
|||||||
|
|
||||||
canEnableTls() {
|
canEnableTls() {
|
||||||
if (![Protocols.VMess, Protocols.VLESS, Protocols.Trojan, Protocols.Shadowsocks].includes(this.protocol)) return false;
|
if (![Protocols.VMess, Protocols.VLESS, Protocols.Trojan, Protocols.Shadowsocks].includes(this.protocol)) return false;
|
||||||
return ["tcp", "ws", "http", "quic", "grpc", "httpupgrade"].includes(this.stream.network);
|
return ["tcp", "ws", "http", "quic", "grpc", "httpupgrade" , "splithttp"].includes(this.stream.network);
|
||||||
}
|
}
|
||||||
|
|
||||||
//this is used for xtls-rprx-vision
|
//this is used for xtls-rprx-vision
|
||||||
@@ -649,6 +675,8 @@ class Outbound extends CommonClass {
|
|||||||
stream.grpc = new GrpcStreamSettings(json.path, json.authority, json.type == 'multi');
|
stream.grpc = new GrpcStreamSettings(json.path, json.authority, json.type == 'multi');
|
||||||
} else if (network === 'httpupgrade') {
|
} else if (network === 'httpupgrade') {
|
||||||
stream.httpupgrade = new HttpUpgradeStreamSettings(json.path,json.host);
|
stream.httpupgrade = new HttpUpgradeStreamSettings(json.path,json.host);
|
||||||
|
} else if (network === 'splithttp') {
|
||||||
|
stream.splithttp = new SplitHTTPStreamSettings(json.path,json.host);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(json.tls && json.tls == 'tls'){
|
if(json.tls && json.tls == 'tls'){
|
||||||
@@ -696,6 +724,8 @@ class Outbound extends CommonClass {
|
|||||||
url.searchParams.get('mode') == 'multi');
|
url.searchParams.get('mode') == 'multi');
|
||||||
} else if (type === 'httpupgrade') {
|
} else if (type === 'httpupgrade') {
|
||||||
stream.httpupgrade = new HttpUpgradeStreamSettings(path,host);
|
stream.httpupgrade = new HttpUpgradeStreamSettings(path,host);
|
||||||
|
} else if (type === 'splithttp') {
|
||||||
|
stream.splithttp = new SplitHTTPStreamSettings(path,host);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(security == 'tls'){
|
if(security == 'tls'){
|
||||||
|
|||||||
@@ -84,6 +84,7 @@ Object.freeze(SSMethods);
|
|||||||
Object.freeze(TLS_FLOW_CONTROL);
|
Object.freeze(TLS_FLOW_CONTROL);
|
||||||
Object.freeze(TLS_VERSION_OPTION);
|
Object.freeze(TLS_VERSION_OPTION);
|
||||||
Object.freeze(TLS_CIPHER_OPTION);
|
Object.freeze(TLS_CIPHER_OPTION);
|
||||||
|
Object.freeze(UTLS_FINGERPRINT);
|
||||||
Object.freeze(ALPN_OPTION);
|
Object.freeze(ALPN_OPTION);
|
||||||
Object.freeze(SNIFFING_OPTION);
|
Object.freeze(SNIFFING_OPTION);
|
||||||
|
|
||||||
@@ -475,6 +476,44 @@ class HttpUpgradeStreamSettings extends XrayCommonClass {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
class SplitHTTPStreamSettings extends XrayCommonClass {
|
||||||
|
constructor(path='/', host='', headers=[] , maxUploadSize= 1, maxConcurrentUploads= 10) {
|
||||||
|
super();
|
||||||
|
this.path = path;
|
||||||
|
this.host = host;
|
||||||
|
this.headers = headers;
|
||||||
|
this.maxUploadSize = maxUploadSize;
|
||||||
|
this.maxConcurrentUploads = maxConcurrentUploads;
|
||||||
|
}
|
||||||
|
|
||||||
|
addHeader(name, value) {
|
||||||
|
this.headers.push({ name: name, value: value });
|
||||||
|
}
|
||||||
|
|
||||||
|
removeHeader(index) {
|
||||||
|
this.headers.splice(index, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
static fromJson(json={}) {
|
||||||
|
return new SplitHTTPStreamSettings(
|
||||||
|
json.path,
|
||||||
|
json.host,
|
||||||
|
XrayCommonClass.toHeaders(json.headers),
|
||||||
|
json.maxUploadSize,
|
||||||
|
json.maxConcurrentUploads,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
toJson() {
|
||||||
|
return {
|
||||||
|
path: this.path,
|
||||||
|
host: this.host,
|
||||||
|
headers: XrayCommonClass.toV2Headers(this.headers, false),
|
||||||
|
maxUploadSize: this.maxUploadSize,
|
||||||
|
maxConcurrentUploads: this.maxConcurrentUploads,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class TlsStreamSettings extends XrayCommonClass {
|
class TlsStreamSettings extends XrayCommonClass {
|
||||||
constructor(serverName='',
|
constructor(serverName='',
|
||||||
@@ -729,6 +768,7 @@ class StreamSettings extends XrayCommonClass {
|
|||||||
quicSettings=new QuicStreamSettings(),
|
quicSettings=new QuicStreamSettings(),
|
||||||
grpcSettings=new GrpcStreamSettings(),
|
grpcSettings=new GrpcStreamSettings(),
|
||||||
httpupgradeSettings=new HttpUpgradeStreamSettings(),
|
httpupgradeSettings=new HttpUpgradeStreamSettings(),
|
||||||
|
splithttpSettings=new SplitHTTPStreamSettings(),
|
||||||
sockopt = undefined,
|
sockopt = undefined,
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
@@ -744,6 +784,7 @@ class StreamSettings extends XrayCommonClass {
|
|||||||
this.quic = quicSettings;
|
this.quic = quicSettings;
|
||||||
this.grpc = grpcSettings;
|
this.grpc = grpcSettings;
|
||||||
this.httpupgrade = httpupgradeSettings;
|
this.httpupgrade = httpupgradeSettings;
|
||||||
|
this.splithttp = splithttpSettings;
|
||||||
this.sockopt = sockopt;
|
this.sockopt = sockopt;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -793,6 +834,7 @@ class StreamSettings extends XrayCommonClass {
|
|||||||
QuicStreamSettings.fromJson(json.quicSettings),
|
QuicStreamSettings.fromJson(json.quicSettings),
|
||||||
GrpcStreamSettings.fromJson(json.grpcSettings),
|
GrpcStreamSettings.fromJson(json.grpcSettings),
|
||||||
HttpUpgradeStreamSettings.fromJson(json.httpupgradeSettings),
|
HttpUpgradeStreamSettings.fromJson(json.httpupgradeSettings),
|
||||||
|
SplitHTTPStreamSettings.fromJson(json.splithttpSettings),
|
||||||
SockoptStreamSettings.fromJson(json.sockopt),
|
SockoptStreamSettings.fromJson(json.sockopt),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -812,6 +854,7 @@ class StreamSettings extends XrayCommonClass {
|
|||||||
quicSettings: network === 'quic' ? this.quic.toJson() : undefined,
|
quicSettings: network === 'quic' ? this.quic.toJson() : undefined,
|
||||||
grpcSettings: network === 'grpc' ? this.grpc.toJson() : undefined,
|
grpcSettings: network === 'grpc' ? this.grpc.toJson() : undefined,
|
||||||
httpupgradeSettings: network === 'httpupgrade' ? this.httpupgrade.toJson() : undefined,
|
httpupgradeSettings: network === 'httpupgrade' ? this.httpupgrade.toJson() : undefined,
|
||||||
|
splithttpSettings: network === 'splithttp' ? this.splithttp.toJson() : undefined,
|
||||||
sockopt: this.sockopt != undefined ? this.sockopt.toJson() : undefined,
|
sockopt: this.sockopt != undefined ? this.sockopt.toJson() : undefined,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -927,6 +970,10 @@ class Inbound extends XrayCommonClass {
|
|||||||
get isHttpupgrade() {
|
get isHttpupgrade() {
|
||||||
return this.network === "httpupgrade";
|
return this.network === "httpupgrade";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get isSplithttp() {
|
||||||
|
return this.network === "splithttp";
|
||||||
|
}
|
||||||
|
|
||||||
// Shadowsocks
|
// Shadowsocks
|
||||||
get method() {
|
get method() {
|
||||||
@@ -967,7 +1014,9 @@ class Inbound extends XrayCommonClass {
|
|||||||
} else if (this.isWs) {
|
} else if (this.isWs) {
|
||||||
return this.stream.ws.host?.length>0 ? this.stream.ws.host : this.getHeader(this.stream.ws, 'host');
|
return this.stream.ws.host?.length>0 ? this.stream.ws.host : this.getHeader(this.stream.ws, 'host');
|
||||||
} else if (this.isHttpupgrade) {
|
} else if (this.isHttpupgrade) {
|
||||||
return this.stream.httpupgrade.host;
|
return this.stream.httpupgrade.host?.length>0 ? this.stream.httpupgrade.host : this.getHeader(this.stream.httpupgrade, 'host');
|
||||||
|
} else if (this.isSplithttp) {
|
||||||
|
return this.stream.splithttp.host?.length>0 ? this.stream.splithttp.host : this.getHeader(this.stream.splithttp, 'host');
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -981,6 +1030,8 @@ class Inbound extends XrayCommonClass {
|
|||||||
return this.stream.http.path;
|
return this.stream.http.path;
|
||||||
} else if (this.isHttpupgrade) {
|
} else if (this.isHttpupgrade) {
|
||||||
return this.stream.httpupgrade.path;
|
return this.stream.httpupgrade.path;
|
||||||
|
} else if (this.isSplithttp) {
|
||||||
|
return this.stream.splithttp.path;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -1016,7 +1067,7 @@ class Inbound extends XrayCommonClass {
|
|||||||
|
|
||||||
canEnableTls() {
|
canEnableTls() {
|
||||||
if(![Protocols.VMESS, Protocols.VLESS, Protocols.TROJAN, Protocols.SHADOWSOCKS].includes(this.protocol)) return false;
|
if(![Protocols.VMESS, Protocols.VLESS, Protocols.TROJAN, Protocols.SHADOWSOCKS].includes(this.protocol)) return false;
|
||||||
return ["tcp", "ws", "http", "quic", "grpc", "httpupgrade"].includes(this.network);
|
return ["tcp", "ws", "http", "quic", "grpc", "httpupgrade" , "splithttp"].includes(this.network);
|
||||||
}
|
}
|
||||||
|
|
||||||
//this is used for xtls-rprx-vision
|
//this is used for xtls-rprx-vision
|
||||||
@@ -1096,7 +1147,11 @@ class Inbound extends XrayCommonClass {
|
|||||||
} else if (network === 'httpupgrade') {
|
} else if (network === 'httpupgrade') {
|
||||||
const httpupgrade = this.stream.httpupgrade;
|
const httpupgrade = this.stream.httpupgrade;
|
||||||
obj.path = httpupgrade.path;
|
obj.path = httpupgrade.path;
|
||||||
obj.host = httpupgrade.host;
|
obj.host = httpupgrade.host?.length>0 ? httpupgrade.host : this.getHeader(httpupgrade, 'host');
|
||||||
|
} else if (network === 'splithttp') {
|
||||||
|
const splithttp = this.stream.splithttp;
|
||||||
|
obj.path = splithttp.path;
|
||||||
|
obj.host = splithttp.host?.length>0 ? splithttp.host : this.getHeader(splithttp, 'host');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (security === 'tls') {
|
if (security === 'tls') {
|
||||||
@@ -1167,10 +1222,15 @@ class Inbound extends XrayCommonClass {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "httpupgrade":
|
case "httpupgrade":
|
||||||
const httpupgrade = this.stream.httpupgrade;
|
const httpupgrade = this.stream.httpupgrade;
|
||||||
params.set("path", httpupgrade.path);
|
params.set("path", httpupgrade.path);
|
||||||
params.set("host", httpupgrade.host);
|
params.set("host", httpupgrade.host?.length>0 ? httpupgrade.host : this.getHeader(httpupgrade, 'host'));
|
||||||
break;
|
break;
|
||||||
|
case "splithttp":
|
||||||
|
const splithttp = this.stream.splithttp;
|
||||||
|
params.set("path", splithttp.path);
|
||||||
|
params.set("host", splithttp.host?.length>0 ? splithttp.host : this.getHeader(splithttp, 'host'));
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (security === 'tls') {
|
if (security === 'tls') {
|
||||||
@@ -1271,10 +1331,15 @@ class Inbound extends XrayCommonClass {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "httpupgrade":
|
case "httpupgrade":
|
||||||
const httpupgrade = this.stream.httpupgrade;
|
const httpupgrade = this.stream.httpupgrade;
|
||||||
params.set("path", httpupgrade.path);
|
params.set("path", httpupgrade.path);
|
||||||
params.set("host", httpupgrade.host);
|
params.set("host", httpupgrade.host?.length>0 ? httpupgrade.host : this.getHeader(httpupgrade, 'host'));
|
||||||
break;
|
break;
|
||||||
|
case "splithttp":
|
||||||
|
const splithttp = this.stream.splithttp;
|
||||||
|
params.set("path", splithttp.path);
|
||||||
|
params.set("host", splithttp.host?.length>0 ? splithttp.host : this.getHeader(splithttp, 'host'));
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (security === 'tls') {
|
if (security === 'tls') {
|
||||||
@@ -1354,10 +1419,15 @@ class Inbound extends XrayCommonClass {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "httpupgrade":
|
case "httpupgrade":
|
||||||
const httpupgrade = this.stream.httpupgrade;
|
const httpupgrade = this.stream.httpupgrade;
|
||||||
params.set("path", httpupgrade.path);
|
params.set("path", httpupgrade.path);
|
||||||
params.set("host", httpupgrade.host);
|
params.set("host", httpupgrade.host?.length>0 ? httpupgrade.host : this.getHeader(httpupgrade, 'host'));
|
||||||
break;
|
break;
|
||||||
|
case "splithttp":
|
||||||
|
const splithttp = this.stream.splithttp;
|
||||||
|
params.set("path", splithttp.path);
|
||||||
|
params.set("host", splithttp.host?.length>0 ? splithttp.host : this.getHeader(splithttp, 'host'));
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (security === 'tls') {
|
if (security === 'tls') {
|
||||||
|
|||||||
@@ -82,20 +82,9 @@
|
|||||||
</template>
|
</template>
|
||||||
<a-input v-model.trim="outbound.settings.address"></a-input>
|
<a-input v-model.trim="outbound.settings.address"></a-input>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item>
|
<a-form-item label='{{ i18n "pages.xray.wireguard.secretKey" }}'>
|
||||||
<template slot="label">
|
|
||||||
<a-tooltip>
|
|
||||||
<template slot="title">
|
|
||||||
<span>{{ i18n "reset" }}</span>
|
|
||||||
</template>
|
|
||||||
{{ i18n "pages.xray.wireguard.secretKey" }}
|
|
||||||
<a-icon type="sync"
|
|
||||||
@click="[outbound.settings.pubKey, outbound.settings.secretKey] = Object.values(Wireguard.generateKeypair())">
|
|
||||||
</a-icon>
|
|
||||||
</a-tooltip>
|
|
||||||
</template>
|
|
||||||
<a-input v-model.trim="outbound.settings.secretKey"></a-input>
|
<a-input v-model.trim="outbound.settings.secretKey"></a-input>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label='{{ i18n "pages.xray.wireguard.publicKey" }}'>
|
<a-form-item label='{{ i18n "pages.xray.wireguard.publicKey" }}'>
|
||||||
<a-input disabled v-model="outbound.settings.pubKey"></a-input>
|
<a-input disabled v-model="outbound.settings.pubKey"></a-input>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@@ -108,7 +97,7 @@
|
|||||||
<a-input-number v-model.number="outbound.settings.mtu"></a-input-number>
|
<a-input-number v-model.number="outbound.settings.mtu"></a-input-number>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label='Workers'>
|
<a-form-item label='Workers'>
|
||||||
<a-input-number min="0" v-model.number="outbound.settings.workers"></a-input>
|
<a-input-number min="0" v-model.number="outbound.settings.workers"></a-input-number>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label='Kernel Mode'>
|
<a-form-item label='Kernel Mode'>
|
||||||
<a-switch v-model="outbound.settings.kernelMode"></a-switch>
|
<a-switch v-model="outbound.settings.kernelMode"></a-switch>
|
||||||
@@ -154,7 +143,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label='Keep Alive'>
|
<a-form-item label='Keep Alive'>
|
||||||
<a-input-number v-model.number="peer.keepAlive" :min="0"></a-input>
|
<a-input-number v-model.number="peer.keepAlive" :min="0"></a-input-number>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-form>
|
</a-form>
|
||||||
</template>
|
</template>
|
||||||
@@ -226,8 +215,8 @@
|
|||||||
<a-select-option value="http">HTTP/2</a-select-option>
|
<a-select-option value="http">HTTP/2</a-select-option>
|
||||||
<a-select-option value="quic">QUIC</a-select-option>
|
<a-select-option value="quic">QUIC</a-select-option>
|
||||||
<a-select-option value="grpc">gRPC</a-select-option>
|
<a-select-option value="grpc">gRPC</a-select-option>
|
||||||
<a-select-option value="httpupgrade">HttpUpgrade</a-select-option>
|
<a-select-option value="httpupgrade">HTTPUpgrade</a-select-option>
|
||||||
</a-select>
|
<a-select-option value="splithttp">SplitHTTP</a-select-option>
|
||||||
</a-select>
|
</a-select>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<template v-if="outbound.stream.network === 'tcp'">
|
<template v-if="outbound.stream.network === 'tcp'">
|
||||||
@@ -351,6 +340,16 @@
|
|||||||
<a-input v-model.trim="outbound.stream.httpupgrade.path"></a-input>
|
<a-input v-model.trim="outbound.stream.httpupgrade.path"></a-input>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<!-- splithttp -->
|
||||||
|
<template v-if="outbound.stream.network === 'splithttp'">
|
||||||
|
<a-form-item label='{{ i18n "host" }}'>
|
||||||
|
<a-input v-model="outbound.stream.splithttp.host"></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label='{{ i18n "path" }}'>
|
||||||
|
<a-input v-model.trim="outbound.stream.splithttp.path"></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</template>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<!-- tls settings -->
|
<!-- tls settings -->
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
<a-select-option value="quic">QUIC</a-select-option>
|
<a-select-option value="quic">QUIC</a-select-option>
|
||||||
<a-select-option value="grpc">gRPC</a-select-option>
|
<a-select-option value="grpc">gRPC</a-select-option>
|
||||||
<a-select-option value="httpupgrade">HttpUpgrade</a-select-option>
|
<a-select-option value="httpupgrade">HttpUpgrade</a-select-option>
|
||||||
|
<a-select-option value="splithttp">SplitHTTP</a-select-option>
|
||||||
</a-select>
|
</a-select>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-form>
|
</a-form>
|
||||||
@@ -50,6 +51,11 @@
|
|||||||
{{template "form/streamHTTPUPGRADE"}}
|
{{template "form/streamHTTPUPGRADE"}}
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<!-- splithttp -->
|
||||||
|
<template v-if="inbound.stream.network === 'splithttp'">
|
||||||
|
{{template "form/streamSplitHTTP"}}
|
||||||
|
</template>
|
||||||
|
|
||||||
<!-- sockopt -->
|
<!-- sockopt -->
|
||||||
<template>
|
<template>
|
||||||
{{template "form/streamSockopt"}}
|
{{template "form/streamSockopt"}}
|
||||||
|
|||||||
29
web/html/xui/form/stream/stream_splithttp.html
Normal file
29
web/html/xui/form/stream/stream_splithttp.html
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
{{define "form/streamSplitHTTP"}}
|
||||||
|
<a-form :colon="false" :label-col="{ md: {span:8} }" :wrapper-col="{ md: {span:14} }">
|
||||||
|
<a-form-item label='{{ i18n "host" }}'>
|
||||||
|
<a-input v-model.trim="inbound.stream.splithttp.host"></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label='{{ i18n "path" }}'>
|
||||||
|
<a-input v-model.trim="inbound.stream.splithttp.path"></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label='{{ i18n "pages.inbounds.stream.tcp.requestHeader" }}'>
|
||||||
|
<a-button icon="plus" size="small" @click="inbound.stream.splithttp.addHeader('host', '')"></a-button>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item :wrapper-col="{span:24}">
|
||||||
|
<a-input-group compact v-for="(header, index) in inbound.stream.splithttp.headers">
|
||||||
|
<a-input style="width: 50%" v-model.trim="header.name" placeholder='{{ i18n "pages.inbounds.stream.general.name"}}'>
|
||||||
|
<template slot="addonBefore" style="margin: 0;">[[ index+1 ]]</template>
|
||||||
|
</a-input>
|
||||||
|
<a-input style="width: 50%" v-model.trim="header.value" placeholder='{{ i18n "pages.inbounds.stream.general.value" }}'>
|
||||||
|
<a-button slot="addonAfter" size="small" @click="inbound.stream.splithttp.removeHeader(index)">-</a-button>
|
||||||
|
</a-input>
|
||||||
|
</a-input-group>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="max Upload Size">
|
||||||
|
<a-input-number v-model="inbound.stream.splithttp.maxUploadSize" :min="0"></a-input-number>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="max Concurrent Uploads">
|
||||||
|
<a-input-number v-model="inbound.stream.splithttp.maxConcurrentUploads" :min="0"></a-input-number>
|
||||||
|
</a-form-item>
|
||||||
|
</a-form>
|
||||||
|
{{end}}
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>{{ i18n "transmission" }}</td><td><a-tag color="blue">[[ inbound.network ]]</a-tag></td>
|
<td>{{ i18n "transmission" }}</td><td><a-tag color="blue">[[ inbound.network ]]</a-tag></td>
|
||||||
</tr>
|
</tr>
|
||||||
<template v-if="inbound.isTcp || inbound.isWs || inbound.isH2 || inbound.isHttpupgrade">
|
<template v-if="inbound.isTcp || inbound.isWs || inbound.isH2 || inbound.isHttpupgrade || inbound.isSplithttp">
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ i18n "host" }}</td>
|
<td>{{ i18n "host" }}</td>
|
||||||
<td v-if="inbound.host">
|
<td v-if="inbound.host">
|
||||||
|
|||||||
Reference in New Issue
Block a user