|
@@ -449,37 +449,6 @@ class HttpStreamSettings extends XrayCommonClass {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-class QuicStreamSettings extends XrayCommonClass {
|
|
|
|
- constructor(
|
|
|
|
- security = 'none',
|
|
|
|
- key = RandomUtil.randomSeq(10),
|
|
|
|
- type = 'none'
|
|
|
|
- ) {
|
|
|
|
- super();
|
|
|
|
- this.security = security;
|
|
|
|
- this.key = key;
|
|
|
|
- this.type = type;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- static fromJson(json = {}) {
|
|
|
|
- return new QuicStreamSettings(
|
|
|
|
- json.security,
|
|
|
|
- json.key,
|
|
|
|
- json.header ? json.header.type : 'none',
|
|
|
|
- );
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- toJson() {
|
|
|
|
- return {
|
|
|
|
- security: this.security,
|
|
|
|
- key: this.key,
|
|
|
|
- header: {
|
|
|
|
- type: this.type,
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
class GrpcStreamSettings extends XrayCommonClass {
|
|
class GrpcStreamSettings extends XrayCommonClass {
|
|
constructor(
|
|
constructor(
|
|
serviceName = "",
|
|
serviceName = "",
|
|
@@ -1092,7 +1061,6 @@ class StreamSettings extends XrayCommonClass {
|
|
kcpSettings = new KcpStreamSettings(),
|
|
kcpSettings = new KcpStreamSettings(),
|
|
wsSettings = new WsStreamSettings(),
|
|
wsSettings = new WsStreamSettings(),
|
|
httpSettings = new HttpStreamSettings(),
|
|
httpSettings = new HttpStreamSettings(),
|
|
- quicSettings = new QuicStreamSettings(),
|
|
|
|
grpcSettings = new GrpcStreamSettings(),
|
|
grpcSettings = new GrpcStreamSettings(),
|
|
httpupgradeSettings = new HTTPUpgradeStreamSettings(),
|
|
httpupgradeSettings = new HTTPUpgradeStreamSettings(),
|
|
splithttpSettings = new SplitHTTPStreamSettings(),
|
|
splithttpSettings = new SplitHTTPStreamSettings(),
|
|
@@ -1109,7 +1077,6 @@ class StreamSettings extends XrayCommonClass {
|
|
this.kcp = kcpSettings;
|
|
this.kcp = kcpSettings;
|
|
this.ws = wsSettings;
|
|
this.ws = wsSettings;
|
|
this.http = httpSettings;
|
|
this.http = httpSettings;
|
|
- this.quic = quicSettings;
|
|
|
|
this.grpc = grpcSettings;
|
|
this.grpc = grpcSettings;
|
|
this.httpupgrade = httpupgradeSettings;
|
|
this.httpupgrade = httpupgradeSettings;
|
|
this.splithttp = splithttpSettings;
|
|
this.splithttp = splithttpSettings;
|
|
@@ -1173,7 +1140,6 @@ class StreamSettings extends XrayCommonClass {
|
|
KcpStreamSettings.fromJson(json.kcpSettings),
|
|
KcpStreamSettings.fromJson(json.kcpSettings),
|
|
WsStreamSettings.fromJson(json.wsSettings),
|
|
WsStreamSettings.fromJson(json.wsSettings),
|
|
HttpStreamSettings.fromJson(json.httpSettings),
|
|
HttpStreamSettings.fromJson(json.httpSettings),
|
|
- QuicStreamSettings.fromJson(json.quicSettings),
|
|
|
|
GrpcStreamSettings.fromJson(json.grpcSettings),
|
|
GrpcStreamSettings.fromJson(json.grpcSettings),
|
|
HTTPUpgradeStreamSettings.fromJson(json.httpupgradeSettings),
|
|
HTTPUpgradeStreamSettings.fromJson(json.httpupgradeSettings),
|
|
SplitHTTPStreamSettings.fromJson(json.splithttpSettings),
|
|
SplitHTTPStreamSettings.fromJson(json.splithttpSettings),
|
|
@@ -1194,7 +1160,6 @@ class StreamSettings extends XrayCommonClass {
|
|
kcpSettings: network === 'kcp' ? this.kcp.toJson() : undefined,
|
|
kcpSettings: network === 'kcp' ? this.kcp.toJson() : undefined,
|
|
wsSettings: network === 'ws' ? this.ws.toJson() : undefined,
|
|
wsSettings: network === 'ws' ? this.ws.toJson() : undefined,
|
|
httpSettings: network === 'http' ? this.http.toJson() : undefined,
|
|
httpSettings: network === 'http' ? this.http.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,
|
|
splithttpSettings: network === 'splithttp' ? this.splithttp.toJson() : undefined,
|
|
@@ -1311,10 +1276,6 @@ class Inbound extends XrayCommonClass {
|
|
return this.network === "kcp";
|
|
return this.network === "kcp";
|
|
}
|
|
}
|
|
|
|
|
|
- get isQuic() {
|
|
|
|
- return this.network === "quic"
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
get isGrpc() {
|
|
get isGrpc() {
|
|
return this.network === "grpc";
|
|
return this.network === "grpc";
|
|
}
|
|
}
|
|
@@ -1393,18 +1354,6 @@ class Inbound extends XrayCommonClass {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
|
|
- get quicSecurity() {
|
|
|
|
- return this.stream.quic.security;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- get quicKey() {
|
|
|
|
- return this.stream.quic.key;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- get quicType() {
|
|
|
|
- return this.stream.quic.type;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
get kcpType() {
|
|
get kcpType() {
|
|
return this.stream.kcp.type;
|
|
return this.stream.kcp.type;
|
|
}
|
|
}
|
|
@@ -1424,7 +1373,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", "splithttp"].includes(this.network);
|
|
|
|
|
|
+ return ["tcp", "ws", "http", "grpc", "httpupgrade", "splithttp"].includes(this.network);
|
|
}
|
|
}
|
|
|
|
|
|
//this is used for xtls-rprx-vision
|
|
//this is used for xtls-rprx-vision
|
|
@@ -1497,10 +1446,6 @@ class Inbound extends XrayCommonClass {
|
|
obj.net = 'h2';
|
|
obj.net = 'h2';
|
|
obj.path = this.stream.http.path;
|
|
obj.path = this.stream.http.path;
|
|
obj.host = this.stream.http.host.join(',');
|
|
obj.host = this.stream.http.host.join(',');
|
|
- } else if (network === 'quic') {
|
|
|
|
- obj.type = this.stream.quic.type;
|
|
|
|
- obj.host = this.stream.quic.security;
|
|
|
|
- obj.path = this.stream.quic.key;
|
|
|
|
} else if (network === 'grpc') {
|
|
} else if (network === 'grpc') {
|
|
obj.path = this.stream.grpc.serviceName;
|
|
obj.path = this.stream.grpc.serviceName;
|
|
obj.authority = this.stream.grpc.authority;
|
|
obj.authority = this.stream.grpc.authority;
|
|
@@ -1570,12 +1515,6 @@ class Inbound extends XrayCommonClass {
|
|
params.set("path", http.path);
|
|
params.set("path", http.path);
|
|
params.set("host", http.host);
|
|
params.set("host", http.host);
|
|
break;
|
|
break;
|
|
- case "quic":
|
|
|
|
- const quic = this.stream.quic;
|
|
|
|
- params.set("quicSecurity", quic.security);
|
|
|
|
- params.set("key", quic.key);
|
|
|
|
- params.set("headerType", quic.type);
|
|
|
|
- break;
|
|
|
|
case "grpc":
|
|
case "grpc":
|
|
const grpc = this.stream.grpc;
|
|
const grpc = this.stream.grpc;
|
|
params.set("serviceName", grpc.serviceName);
|
|
params.set("serviceName", grpc.serviceName);
|
|
@@ -1691,12 +1630,6 @@ class Inbound extends XrayCommonClass {
|
|
params.set("path", http.path);
|
|
params.set("path", http.path);
|
|
params.set("host", http.host);
|
|
params.set("host", http.host);
|
|
break;
|
|
break;
|
|
- case "quic":
|
|
|
|
- const quic = this.stream.quic;
|
|
|
|
- params.set("quicSecurity", quic.security);
|
|
|
|
- params.set("key", quic.key);
|
|
|
|
- params.set("headerType", quic.type);
|
|
|
|
- break;
|
|
|
|
case "grpc":
|
|
case "grpc":
|
|
const grpc = this.stream.grpc;
|
|
const grpc = this.stream.grpc;
|
|
params.set("serviceName", grpc.serviceName);
|
|
params.set("serviceName", grpc.serviceName);
|
|
@@ -1779,12 +1712,6 @@ class Inbound extends XrayCommonClass {
|
|
params.set("path", http.path);
|
|
params.set("path", http.path);
|
|
params.set("host", http.host);
|
|
params.set("host", http.host);
|
|
break;
|
|
break;
|
|
- case "quic":
|
|
|
|
- const quic = this.stream.quic;
|
|
|
|
- params.set("quicSecurity", quic.security);
|
|
|
|
- params.set("key", quic.key);
|
|
|
|
- params.set("headerType", quic.type);
|
|
|
|
- break;
|
|
|
|
case "grpc":
|
|
case "grpc":
|
|
const grpc = this.stream.grpc;
|
|
const grpc = this.stream.grpc;
|
|
params.set("serviceName", grpc.serviceName);
|
|
params.set("serviceName", grpc.serviceName);
|