From b27199d307573b977d2ff0890be37913f467f3a8 Mon Sep 17 00:00:00 2001 From: mhsanaei Date: Tue, 8 Oct 2024 15:35:17 +0200 Subject: [PATCH] remove quic --- sub/subService.go | 24 ------- web/assets/js/model/outbound.js | 44 +----------- web/assets/js/model/xray.js | 71 +------------------ web/html/xui/form/outbound.html | 29 +------- web/html/xui/form/stream/stream_quic.html | 33 --------- web/html/xui/form/stream/stream_settings.html | 12 +--- web/html/xui/inbound_info_modal.html | 6 -- web/translation/translate.en_US.toml | 3 - web/translation/translate.fa_IR.toml | 3 - web/translation/translate.ru_RU.toml | 3 - web/translation/translate.vi_VN.toml | 3 - web/translation/translate.zh_Hans.toml | 3 - 12 files changed, 7 insertions(+), 227 deletions(-) delete mode 100644 web/html/xui/form/stream/stream_quic.html diff --git a/sub/subService.go b/sub/subService.go index 80888802..607a001c 100644 --- a/sub/subService.go +++ b/sub/subService.go @@ -205,12 +205,6 @@ func (s *SubService) genVmessLink(inbound *model.Inbound, email string) string { http, _ := stream["httpSettings"].(map[string]interface{}) obj["path"], _ = http["path"].(string) obj["host"] = searchHost(http) - case "quic": - quic, _ := stream["quicSettings"].(map[string]interface{}) - header := quic["header"].(map[string]interface{}) - obj["type"], _ = header["type"].(string) - obj["host"], _ = quic["security"].(string) - obj["path"], _ = quic["key"].(string) case "grpc": grpc, _ := stream["grpcSettings"].(map[string]interface{}) obj["path"], _ = grpc["serviceName"].(string) @@ -362,12 +356,6 @@ func (s *SubService) genVlessLink(inbound *model.Inbound, email string) string { http, _ := stream["httpSettings"].(map[string]interface{}) params["path"] = http["path"].(string) params["host"] = searchHost(http) - case "quic": - quic, _ := stream["quicSettings"].(map[string]interface{}) - params["quicSecurity"] = quic["security"].(string) - params["key"] = quic["key"].(string) - header := quic["header"].(map[string]interface{}) - params["headerType"] = header["type"].(string) case "grpc": grpc, _ := stream["grpcSettings"].(map[string]interface{}) params["serviceName"] = grpc["serviceName"].(string) @@ -565,12 +553,6 @@ func (s *SubService) genTrojanLink(inbound *model.Inbound, email string) string http, _ := stream["httpSettings"].(map[string]interface{}) params["path"] = http["path"].(string) params["host"] = searchHost(http) - case "quic": - quic, _ := stream["quicSettings"].(map[string]interface{}) - params["quicSecurity"] = quic["security"].(string) - params["key"] = quic["key"].(string) - header := quic["header"].(map[string]interface{}) - params["headerType"] = header["type"].(string) case "grpc": grpc, _ := stream["grpcSettings"].(map[string]interface{}) params["serviceName"] = grpc["serviceName"].(string) @@ -764,12 +746,6 @@ func (s *SubService) genShadowsocksLink(inbound *model.Inbound, email string) st http, _ := stream["httpSettings"].(map[string]interface{}) params["path"] = http["path"].(string) params["host"] = searchHost(http) - case "quic": - quic, _ := stream["quicSettings"].(map[string]interface{}) - params["quicSecurity"] = quic["security"].(string) - params["key"] = quic["key"].(string) - header := quic["header"].(map[string]interface{}) - params["headerType"] = header["type"].(string) case "grpc": grpc, _ := stream["grpcSettings"].(map[string]interface{}) params["serviceName"] = grpc["serviceName"].(string) diff --git a/web/assets/js/model/outbound.js b/web/assets/js/model/outbound.js index 96a4c549..76487ab7 100644 --- a/web/assets/js/model/outbound.js +++ b/web/assets/js/model/outbound.js @@ -228,34 +228,6 @@ class HttpStreamSettings extends CommonClass { } } -class QuicStreamSettings extends CommonClass { - constructor(security='none', - key='', 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 CommonClass { constructor(serviceName="", authority="", multiMode=false) { super(); @@ -419,7 +391,6 @@ class StreamSettings extends CommonClass { kcpSettings=new KcpStreamSettings(), wsSettings=new WsStreamSettings(), httpSettings=new HttpStreamSettings(), - quicSettings=new QuicStreamSettings(), grpcSettings=new GrpcStreamSettings(), httpupgradeSettings=new HttpUpgradeStreamSettings(), splithttpSettings=new SplitHTTPStreamSettings(), @@ -434,7 +405,6 @@ class StreamSettings extends CommonClass { this.kcp = kcpSettings; this.ws = wsSettings; this.http = httpSettings; - this.quic = quicSettings; this.grpc = grpcSettings; this.httpupgrade = httpupgradeSettings; this.splithttp = splithttpSettings; @@ -467,7 +437,6 @@ class StreamSettings extends CommonClass { KcpStreamSettings.fromJson(json.kcpSettings), WsStreamSettings.fromJson(json.wsSettings), HttpStreamSettings.fromJson(json.httpSettings), - QuicStreamSettings.fromJson(json.quicSettings), GrpcStreamSettings.fromJson(json.grpcSettings), HttpUpgradeStreamSettings.fromJson(json.httpupgradeSettings), SplitHTTPStreamSettings.fromJson(json.splithttpSettings), @@ -486,7 +455,6 @@ class StreamSettings extends CommonClass { kcpSettings: network === 'kcp' ? this.kcp.toJson() : undefined, wsSettings: network === 'ws' ? this.ws.toJson() : undefined, httpSettings: network === 'http' ? this.http.toJson() : undefined, - quicSettings: network === 'quic' ? this.quic.toJson() : undefined, grpcSettings: network === 'grpc' ? this.grpc.toJson() : undefined, httpupgradeSettings: network === 'httpupgrade' ? this.httpupgrade.toJson() : undefined, splithttpSettings: network === 'splithttp' ? this.splithttp.toJson() : undefined, @@ -554,7 +522,7 @@ class Outbound extends CommonClass { canEnableTls() { if (![Protocols.VMess, Protocols.VLESS, Protocols.Trojan, Protocols.Shadowsocks].includes(this.protocol)) return false; - return ["tcp", "ws", "http", "quic", "grpc", "httpupgrade" , "splithttp"].includes(this.stream.network); + return ["tcp", "ws", "http", "grpc", "httpupgrade" , "splithttp"].includes(this.stream.network); } //this is used for xtls-rprx-vision @@ -670,11 +638,6 @@ class Outbound extends CommonClass { stream.http = new HttpStreamSettings( json.path, json.host); - } else if (network === 'quic') { - stream.quic = new QuicStreamSettings( - json.host ? json.host : 'none', - json.path, - json.type ? json.type : 'none'); } else if (network === 'grpc') { stream.grpc = new GrpcStreamSettings(json.path, json.authority, json.type == 'multi'); } else if (network === 'httpupgrade') { @@ -716,11 +679,6 @@ class Outbound extends CommonClass { stream.ws = new WsStreamSettings(path,host); } else if (type === 'http' || type == 'h2') { stream.http = new HttpStreamSettings(path,host); - } else if (type === 'quic') { - stream.quic = new QuicStreamSettings( - url.searchParams.get('quicSecurity') ?? 'none', - url.searchParams.get('key') ?? '', - headerType ?? 'none'); } else if (type === 'grpc') { stream.grpc = new GrpcStreamSettings( url.searchParams.get('serviceName') ?? '', diff --git a/web/assets/js/model/xray.js b/web/assets/js/model/xray.js index d8538e87..32d903ce 100644 --- a/web/assets/js/model/xray.js +++ b/web/assets/js/model/xray.js @@ -392,34 +392,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 { constructor(serviceName='', authority='', multiMode=false) { super(); @@ -797,7 +769,6 @@ class StreamSettings extends XrayCommonClass { kcpSettings=new KcpStreamSettings(), wsSettings=new WsStreamSettings(), httpSettings=new HttpStreamSettings(), - quicSettings=new QuicStreamSettings(), grpcSettings=new GrpcStreamSettings(), httpupgradeSettings=new HttpUpgradeStreamSettings(), splithttpSettings=new SplitHTTPStreamSettings(), @@ -813,7 +784,6 @@ class StreamSettings extends XrayCommonClass { this.kcp = kcpSettings; this.ws = wsSettings; this.http = httpSettings; - this.quic = quicSettings; this.grpc = grpcSettings; this.httpupgrade = httpupgradeSettings; this.splithttp = splithttpSettings; @@ -863,7 +833,6 @@ class StreamSettings extends XrayCommonClass { KcpStreamSettings.fromJson(json.kcpSettings), WsStreamSettings.fromJson(json.wsSettings), HttpStreamSettings.fromJson(json.httpSettings), - QuicStreamSettings.fromJson(json.quicSettings), GrpcStreamSettings.fromJson(json.grpcSettings), HttpUpgradeStreamSettings.fromJson(json.httpupgradeSettings), SplitHTTPStreamSettings.fromJson(json.splithttpSettings), @@ -883,7 +852,6 @@ class StreamSettings extends XrayCommonClass { kcpSettings: network === 'kcp' ? this.kcp.toJson() : undefined, wsSettings: network === 'ws' ? this.ws.toJson() : undefined, httpSettings: network === 'http' ? this.http.toJson() : undefined, - quicSettings: network === 'quic' ? this.quic.toJson() : undefined, grpcSettings: network === 'grpc' ? this.grpc.toJson() : undefined, httpupgradeSettings: network === 'httpupgrade' ? this.httpupgrade.toJson() : undefined, splithttpSettings: network === 'splithttp' ? this.splithttp.toJson() : undefined, @@ -987,10 +955,6 @@ class Inbound extends XrayCommonClass { return this.network === "kcp"; } - get isQuic() { - return this.network === "quic" - } - get isGrpc() { return this.network === "grpc"; } @@ -1068,17 +1032,6 @@ class Inbound extends XrayCommonClass { 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() { return this.stream.kcp.type; @@ -1099,7 +1052,7 @@ class Inbound extends XrayCommonClass { canEnableTls() { 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 @@ -1166,10 +1119,6 @@ class Inbound extends XrayCommonClass { obj.net = 'h2'; obj.path = this.stream.http.path; 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') { obj.path = this.stream.grpc.serviceName; obj.authority = this.stream.grpc.authority; @@ -1239,12 +1188,6 @@ class Inbound extends XrayCommonClass { params.set("path", http.path); params.set("host", http.host); 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": const grpc = this.stream.grpc; params.set("serviceName", grpc.serviceName); @@ -1348,12 +1291,6 @@ class Inbound extends XrayCommonClass { params.set("path", http.path); params.set("host", http.host); 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": const grpc = this.stream.grpc; params.set("serviceName", grpc.serviceName); @@ -1436,12 +1373,6 @@ class Inbound extends XrayCommonClass { params.set("path", http.path); params.set("host", http.host); 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": const grpc = this.stream.grpc; params.set("serviceName", grpc.serviceName); diff --git a/web/html/xui/form/outbound.html b/web/html/xui/form/outbound.html index 3cce3391..e37874bd 100644 --- a/web/html/xui/form/outbound.html +++ b/web/html/xui/form/outbound.html @@ -240,8 +240,7 @@ TCP mKCP WebSocket - HTTP/2 - QUIC + HTTP gRPC HTTPUpgrade SplitHTTP @@ -321,31 +320,7 @@ - - - - + - - - - -