diff --git a/sub/subService.go b/sub/subService.go index 7edad63f..9ea634aa 100644 --- a/sub/subService.go +++ b/sub/subService.go @@ -200,11 +200,6 @@ func (s *SubService) genVmessLink(inbound *model.Inbound, email string) string { headers, _ := ws["headers"].(map[string]interface{}) obj["host"] = searchHost(headers) } - case "http": - obj["net"] = "h2" - http, _ := stream["httpSettings"].(map[string]interface{}) - obj["path"], _ = http["path"].(string) - obj["host"] = searchHost(http) case "grpc": grpc, _ := stream["grpcSettings"].(map[string]interface{}) obj["path"], _ = grpc["serviceName"].(string) @@ -353,10 +348,6 @@ func (s *SubService) genVlessLink(inbound *model.Inbound, email string) string { headers, _ := ws["headers"].(map[string]interface{}) params["host"] = searchHost(headers) } - case "http": - http, _ := stream["httpSettings"].(map[string]interface{}) - params["path"] = http["path"].(string) - params["host"] = searchHost(http) case "grpc": grpc, _ := stream["grpcSettings"].(map[string]interface{}) params["serviceName"] = grpc["serviceName"].(string) @@ -551,10 +542,6 @@ func (s *SubService) genTrojanLink(inbound *model.Inbound, email string) string headers, _ := ws["headers"].(map[string]interface{}) params["host"] = searchHost(headers) } - case "http": - http, _ := stream["httpSettings"].(map[string]interface{}) - params["path"] = http["path"].(string) - params["host"] = searchHost(http) case "grpc": grpc, _ := stream["grpcSettings"].(map[string]interface{}) params["serviceName"] = grpc["serviceName"].(string) @@ -745,10 +732,6 @@ func (s *SubService) genShadowsocksLink(inbound *model.Inbound, email string) st headers, _ := ws["headers"].(map[string]interface{}) params["host"] = searchHost(headers) } - case "http": - http, _ := stream["httpSettings"].(map[string]interface{}) - params["path"] = http["path"].(string) - params["host"] = searchHost(http) case "grpc": grpc, _ := stream["grpcSettings"].(map[string]interface{}) params["serviceName"] = grpc["serviceName"].(string) diff --git a/web/assets/js/model/inbound.js b/web/assets/js/model/inbound.js index 8858c8ad..4f1bab77 100644 --- a/web/assets/js/model/inbound.js +++ b/web/assets/js/model/inbound.js @@ -368,39 +368,6 @@ class WsStreamSettings extends XrayCommonClass { } } -class HttpStreamSettings extends XrayCommonClass { - constructor(path='/', host=['']) { - super(); - this.path = path; - this.host = host.length === 0 ? [''] : host; - } - - addHost(host) { - this.host.push(host); - } - - removeHost(index) { - this.host.splice(index, 1); - } - - static fromJson(json={}) { - return new HttpStreamSettings(json.path, json.host); - } - - toJson() { - let host = []; - for (let i = 0; i < this.host.length; ++i) { - if (!ObjectUtil.isEmpty(this.host[i])) { - host.push(this.host[i]); - } - } - return { - path: this.path, - host: host, - } - } -} - class GrpcStreamSettings extends XrayCommonClass { constructor(serviceName='', authority='', multiMode=false) { super(); @@ -771,7 +738,6 @@ class StreamSettings extends XrayCommonClass { tcpSettings=new TcpStreamSettings(), kcpSettings=new KcpStreamSettings(), wsSettings=new WsStreamSettings(), - httpSettings=new HttpStreamSettings(), grpcSettings=new GrpcStreamSettings(), httpupgradeSettings=new HttpUpgradeStreamSettings(), xhttpSettings=new xHTTPStreamSettings(), @@ -786,7 +752,6 @@ class StreamSettings extends XrayCommonClass { this.tcp = tcpSettings; this.kcp = kcpSettings; this.ws = wsSettings; - this.http = httpSettings; this.grpc = grpcSettings; this.httpupgrade = httpupgradeSettings; this.xhttp = xhttpSettings; @@ -835,7 +800,6 @@ class StreamSettings extends XrayCommonClass { TcpStreamSettings.fromJson(json.tcpSettings), KcpStreamSettings.fromJson(json.kcpSettings), WsStreamSettings.fromJson(json.wsSettings), - HttpStreamSettings.fromJson(json.httpSettings), GrpcStreamSettings.fromJson(json.grpcSettings), HttpUpgradeStreamSettings.fromJson(json.httpupgradeSettings), xHTTPStreamSettings.fromJson(json.xhttpSettings), @@ -854,7 +818,6 @@ class StreamSettings extends XrayCommonClass { tcpSettings: network === 'tcp' ? this.tcp.toJson() : undefined, kcpSettings: network === 'kcp' ? this.kcp.toJson() : undefined, wsSettings: network === 'ws' ? this.ws.toJson() : undefined, - httpSettings: network === 'http' ? this.http.toJson() : undefined, grpcSettings: network === 'grpc' ? this.grpc.toJson() : undefined, httpupgradeSettings: network === 'httpupgrade' ? this.httpupgrade.toJson() : undefined, xhttpSettings: network === 'xhttp' ? this.xhttp.toJson() : undefined, @@ -962,10 +925,6 @@ class Inbound extends XrayCommonClass { return this.network === "grpc"; } - get isH2() { - return this.network === "http"; - } - get isHttpupgrade() { return this.network === "httpupgrade"; } @@ -1008,8 +967,6 @@ class Inbound extends XrayCommonClass { get host() { if (this.isTcp) { return this.getHeader(this.stream.tcp.request, 'host'); - } else if (this.isH2) { - return this.stream.http.host[0]; } else if (this.isWs) { return this.stream.ws.host?.length>0 ? this.stream.ws.host : this.getHeader(this.stream.ws, 'host'); } else if (this.isHttpupgrade) { @@ -1025,8 +982,6 @@ class Inbound extends XrayCommonClass { return this.stream.tcp.request.path[0]; } else if (this.isWs) { return this.stream.ws.path; - } else if (this.isH2) { - return this.stream.http.path; } else if (this.isHttpupgrade) { return this.stream.httpupgrade.path; } else if (this.isXHTTP) { @@ -1187,11 +1142,6 @@ class Inbound extends XrayCommonClass { params.set("path", ws.path); params.set("host", ws.host?.length>0 ? ws.host : this.getHeader(ws, 'host')); break; - case "http": - const http = this.stream.http; - params.set("path", http.path); - params.set("host", http.host); - break; case "grpc": const grpc = this.stream.grpc; params.set("serviceName", grpc.serviceName); @@ -1291,11 +1241,6 @@ class Inbound extends XrayCommonClass { params.set("path", ws.path); params.set("host", ws.host?.length>0 ? ws.host : this.getHeader(ws, 'host')); break; - case "http": - const http = this.stream.http; - params.set("path", http.path); - params.set("host", http.host); - break; case "grpc": const grpc = this.stream.grpc; params.set("serviceName", grpc.serviceName); @@ -1374,11 +1319,6 @@ class Inbound extends XrayCommonClass { params.set("path", ws.path); params.set("host", ws.host?.length>0 ? ws.host : this.getHeader(ws, 'host')); break; - case "http": - const http = this.stream.http; - params.set("path", http.path); - params.set("host", http.host); - break; case "grpc": const grpc = this.stream.grpc; params.set("serviceName", grpc.serviceName); diff --git a/web/assets/js/model/outbound.js b/web/assets/js/model/outbound.js index 3efe1f2e..d8be9283 100644 --- a/web/assets/js/model/outbound.js +++ b/web/assets/js/model/outbound.js @@ -214,28 +214,6 @@ class WsStreamSettings extends CommonClass { } } -class HttpStreamSettings extends CommonClass { - constructor(path='/', host='') { - super(); - this.path = path; - this.host = host; - } - - static fromJson(json={}) { - return new HttpStreamSettings( - json.path, - json.host ? json.host.join(',') : '', - ); - } - - toJson() { - return { - path: this.path, - host: ObjectUtil.isEmpty(this.host) ? [''] : this.host.split(','), - } - } -} - class GrpcStreamSettings extends CommonClass { constructor(serviceName="", authority="", multiMode=false) { super(); @@ -431,7 +409,6 @@ class StreamSettings extends CommonClass { tcpSettings=new TcpStreamSettings(), kcpSettings=new KcpStreamSettings(), wsSettings=new WsStreamSettings(), - httpSettings=new HttpStreamSettings(), grpcSettings=new GrpcStreamSettings(), httpupgradeSettings=new HttpUpgradeStreamSettings(), xhttpSettings=new xHTTPStreamSettings(), @@ -445,7 +422,6 @@ class StreamSettings extends CommonClass { this.tcp = tcpSettings; this.kcp = kcpSettings; this.ws = wsSettings; - this.http = httpSettings; this.grpc = grpcSettings; this.httpupgrade = httpupgradeSettings; this.xhttp = xhttpSettings; @@ -477,7 +453,6 @@ class StreamSettings extends CommonClass { TcpStreamSettings.fromJson(json.tcpSettings), KcpStreamSettings.fromJson(json.kcpSettings), WsStreamSettings.fromJson(json.wsSettings), - HttpStreamSettings.fromJson(json.httpSettings), GrpcStreamSettings.fromJson(json.grpcSettings), HttpUpgradeStreamSettings.fromJson(json.httpupgradeSettings), xHTTPStreamSettings.fromJson(json.xhttpSettings), @@ -495,7 +470,6 @@ class StreamSettings extends CommonClass { tcpSettings: network === 'tcp' ? this.tcp.toJson() : undefined, kcpSettings: network === 'kcp' ? this.kcp.toJson() : undefined, wsSettings: network === 'ws' ? this.ws.toJson() : undefined, - httpSettings: network === 'http' ? this.http.toJson() : undefined, grpcSettings: network === 'grpc' ? this.grpc.toJson() : undefined, httpupgradeSettings: network === 'httpupgrade' ? this.httpupgrade.toJson() : undefined, xhttpSettings: network === 'xhttp' ? this.xhttp.toJson() : undefined, @@ -674,11 +648,6 @@ class Outbound extends CommonClass { stream.seed = json.path; } else if (network === 'ws') { stream.ws = new WsStreamSettings(json.path,json.host); - } else if (network === 'http' || network == 'h2') { - stream.network = 'http' - stream.http = new HttpStreamSettings( - json.path, - json.host); } else if (network === 'grpc') { stream.grpc = new GrpcStreamSettings(json.path, json.authority, json.type == 'multi'); } else if (network === 'httpupgrade') { @@ -718,8 +687,6 @@ class Outbound extends CommonClass { stream.kcp.seed = path; } else if (type === 'ws') { stream.ws = new WsStreamSettings(path,host); - } else if (type === 'http' || type == 'h2') { - stream.http = new HttpStreamSettings(path,host); } else if (type === 'grpc') { stream.grpc = new GrpcStreamSettings( url.searchParams.get('serviceName') ?? '', diff --git a/web/html/xui/form/outbound.html b/web/html/xui/form/outbound.html index 53a2bd2f..f70ecd96 100644 --- a/web/html/xui/form/outbound.html +++ b/web/html/xui/form/outbound.html @@ -259,7 +259,6 @@ TCP mKCP WebSocket - HTTP gRPC HTTPUpgrade XHTTP @@ -329,16 +328,6 @@ - - - - - - - - - - diff --git a/web/html/xui/form/stream/stream_http.html b/web/html/xui/form/stream/stream_http.html deleted file mode 100644 index 3a05655f..00000000 --- a/web/html/xui/form/stream/stream_http.html +++ /dev/null @@ -1,19 +0,0 @@ -{{define "form/streamHTTP"}} - - - - - - {{ i18n "host" }} - + - - - - - - - - - -{{end}} \ No newline at end of file diff --git a/web/html/xui/form/stream/stream_settings.html b/web/html/xui/form/stream/stream_settings.html index d6c84819..07bc6042 100644 --- a/web/html/xui/form/stream/stream_settings.html +++ b/web/html/xui/form/stream/stream_settings.html @@ -7,7 +7,6 @@ TCP (RAW) mKCP WebSocket - HTTP gRPC HttpUpgrade XHTTP @@ -30,11 +29,6 @@ {{template "form/streamWS"}} - - - {{template "form/streamHTTP"}} - - {{template "form/streamGRPC"}} diff --git a/web/html/xui/inbound_info_modal.html b/web/html/xui/inbound_info_modal.html index 0f8f1216..70ed5bf2 100644 --- a/web/html/xui/inbound_info_modal.html +++ b/web/html/xui/inbound_info_modal.html @@ -25,7 +25,7 @@ {{ i18n "transmission" }}[[ inbound.network ]] - + {{ i18n "host" }}