diff --git a/config/version b/config/version index dfb6d22..7bddcbb 100644 --- a/config/version +++ b/config/version @@ -1 +1 @@ -24.12.02 \ No newline at end of file +24.12.10 \ No newline at end of file diff --git a/go.mod b/go.mod index 0fc15db..11ac22b 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/op/go-logging v0.0.0-20160315200505-970db520ece7 github.com/robfig/cron/v3 v3.0.1 github.com/shirou/gopsutil/v3 v3.24.5 - github.com/xtls/xray-core v1.8.25-0.20241201231301-03d7d07c5b77 + github.com/xtls/xray-core v1.8.25-0.20241207144338-9cb6816383dd go.uber.org/atomic v1.11.0 golang.org/x/crypto v0.30.0 golang.org/x/text v0.21.0 @@ -57,7 +57,7 @@ require ( github.com/ugorji/go/codec v1.2.12 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect golang.org/x/arch v0.8.0 // indirect - golang.org/x/net v0.31.0 // indirect + golang.org/x/net v0.32.0 // indirect golang.org/x/sys v0.28.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect google.golang.org/protobuf v1.35.2 // indirect diff --git a/go.sum b/go.sum index 65f7952..b4d62ff 100644 --- a/go.sum +++ b/go.sum @@ -164,8 +164,8 @@ github.com/vishvananda/netns v0.0.4 h1:Oeaw1EM2JMxD51g9uhtC0D7erkIjgmj8+JZc26m1Y github.com/vishvananda/netns v0.0.4/go.mod h1:SpkAiCQRtJ6TvvxPnOSyH3BMl6unz3xZlaprSwhNNJM= github.com/xtls/reality v0.0.0-20240712055506-48f0b2d5ed6d h1:+B97uD9uHLgAAulhigmys4BVwZZypzK7gPN3WtpgRJg= github.com/xtls/reality v0.0.0-20240712055506-48f0b2d5ed6d/go.mod h1:dm4y/1QwzjGaK17ofi0Vs6NpKAHegZky8qk6J2JJZAE= -github.com/xtls/xray-core v1.8.25-0.20241201231301-03d7d07c5b77 h1:4s1Q/Wb7Iwuzwgkoe1d48hSmexwlUOn+XJQ7sOuWSDQ= -github.com/xtls/xray-core v1.8.25-0.20241201231301-03d7d07c5b77/go.mod h1:BCeSy6P4xz8vSk46ziVkg0iby82W2Mmqvz2ub5kfYrc= +github.com/xtls/xray-core v1.8.25-0.20241207144338-9cb6816383dd h1:jcGpaTPQUgFqCeG2Ek5Yj1fwVsoI4LcIDJNXuC2qMaA= +github.com/xtls/xray-core v1.8.25-0.20241207144338-9cb6816383dd/go.mod h1:jTHrem03qe2KEk7RttKZbHk0VdJDf0CWQ9B+/2FXNI0= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= @@ -191,8 +191,8 @@ golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= -golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= +golang.org/x/net v0.32.0 h1:ZqPmj8Kzc+Y6e0+skZsuACbx+wzMgo5MQsJh9Qd6aYI= +golang.org/x/net v0.32.0/go.mod h1:CwU0IoeOlnQQWJ6ioyFrfRuomB8GKF6KbYXZVyeXNfs= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= diff --git a/web/assets/js/model/xray.js b/web/assets/js/model/xray.js index 3740f5f..a3ea2bf 100644 --- a/web/assets/js/model/xray.js +++ b/web/assets/js/model/xray.js @@ -117,6 +117,7 @@ const MODE_OPTION = { AUTO: "auto", PACKET_UP: "packet-up", STREAM_UP: "stream-up", + STREAM_ONE: "stream-one", }; Object.freeze(Protocols); @@ -521,7 +522,7 @@ class HttpUpgradeStreamSettings extends XrayCommonClass { } } -class SplitHTTPStreamSettings extends XrayCommonClass { +class xHTTPStreamSettings extends XrayCommonClass { constructor( path = '/', host = '', @@ -532,9 +533,9 @@ class SplitHTTPStreamSettings extends XrayCommonClass { noSSEHeader = false, xPaddingBytes = "100-1000", xmux = { - maxConnections: '', - maxConcurrency: '', - cMaxReuseTimes: 0, + maxConnections: '16-32', + maxConcurrency: 0, + cMaxReuseTimes: '64-128', cMaxLifetimeMs: 0 }, mode = MODE_OPTION.AUTO, @@ -570,7 +571,7 @@ class SplitHTTPStreamSettings extends XrayCommonClass { } static fromJson(json = {}) { - return new SplitHTTPStreamSettings( + return new xHTTPStreamSettings( json.path, json.host, XrayCommonClass.toHeaders(json.headers), @@ -908,7 +909,7 @@ class StreamSettings extends XrayCommonClass { httpSettings = new HttpStreamSettings(), grpcSettings = new GrpcStreamSettings(), httpupgradeSettings = new HttpUpgradeStreamSettings(), - splithttpSettings = new SplitHTTPStreamSettings(), + xhttpSettings = new xHTTPStreamSettings(), sockopt = undefined, ) { super(); @@ -923,7 +924,7 @@ class StreamSettings extends XrayCommonClass { this.http = httpSettings; this.grpc = grpcSettings; this.httpupgrade = httpupgradeSettings; - this.splithttp = splithttpSettings; + this.xhttp = xhttpSettings; this.sockopt = sockopt; } @@ -972,7 +973,7 @@ class StreamSettings extends XrayCommonClass { HttpStreamSettings.fromJson(json.httpSettings), GrpcStreamSettings.fromJson(json.grpcSettings), HttpUpgradeStreamSettings.fromJson(json.httpupgradeSettings), - SplitHTTPStreamSettings.fromJson(json.splithttpSettings), + xHTTPStreamSettings.fromJson(json.xhttpSettings), SockoptStreamSettings.fromJson(json.sockopt), ); } @@ -991,7 +992,7 @@ class StreamSettings extends XrayCommonClass { httpSettings: network === 'http' ? this.http.toJson() : undefined, grpcSettings: network === 'grpc' ? this.grpc.toJson() : undefined, httpupgradeSettings: network === 'httpupgrade' ? this.httpupgrade.toJson() : undefined, - splithttpSettings: network === 'splithttp' ? this.splithttp.toJson() : undefined, + xhttpSettings: network === 'xhttp' ? this.xhttp.toJson() : undefined, sockopt: this.sockopt != undefined ? this.sockopt.toJson() : undefined, }; } @@ -1109,8 +1110,8 @@ class Inbound extends XrayCommonClass { get isHttpupgrade() { return this.network === "httpupgrade"; } - get isSplithttp() { - return this.network === "splithttp"; + get isXHTTP() { + return this.network === "xhttp"; } // VMess & VLess get uuid() { @@ -1190,8 +1191,8 @@ class Inbound extends XrayCommonClass { return this.stream.http.host[0]; } else if (this.isHttpupgrade) { return this.stream.httpupgrade.host; - } else if (this.isSplithttp) { - return this.stream.splithttp.host; + } else if (this.isXHTTP) { + return this.stream.xhttp.host; } return null; } @@ -1207,8 +1208,8 @@ class Inbound extends XrayCommonClass { return this.stream.http.path[0]; } else if (this.isHttpupgrade) { return this.stream.httpupgrade.path; - } else if (this.isSplithttp) { - return this.stream.splithttp.path; + } else if (this.isXHTTP) { + return this.stream.xhttp.path; } return null; } @@ -1243,7 +1244,7 @@ class Inbound extends XrayCommonClass { case "http": case "grpc": case "httpupgrade": - case "splithttp": + case "xhttp": return true; default: return false; @@ -1262,7 +1263,7 @@ class Inbound extends XrayCommonClass { default: return false; } - return ['tcp', 'raw', 'http', 'grpc', 'httpupgrade', 'splithttp'].indexOf(this.network) !== -1; + return ['tcp', 'raw', 'http', 'grpc', 'httpupgrade', 'xhttp'].indexOf(this.network) !== -1; //return this.network === "tcp"; } @@ -1376,15 +1377,15 @@ class Inbound extends XrayCommonClass { if (index >= 0) { host = httpupgrade.headers[index].value; } - } else if (network === 'splithttp') { - const splithttp = this.stream.splithttp; - path = splithttp.path; - host = splithttp.host; - let index = splithttp.headers.findIndex(header => header.name.toLowerCase() === 'host'); + } else if (network === 'xhttp') { + const xhttp = this.stream.xhttp; + path = xhttp.path; + host = xhttp.host; + let index = xhttp.headers.findIndex(header => header.name.toLowerCase() === 'host'); if (index >= 0) { - host = splithttp.headers[index].value; + host = xhttp.headers[index].value; }; - mode = splithttp.mode; + mode = xhttp.mode; } if (this.stream.security === 'tls') { @@ -1406,7 +1407,7 @@ class Inbound extends XrayCommonClass { type: type, host: host, path: path, - ...(network === 'splithttp' && { mode: mode }), + ...(network === 'xhttp' && { mode: mode }), authority: authority, tls: this.stream.security, sni: sni, @@ -1489,16 +1490,16 @@ class Inbound extends XrayCommonClass { params.set("host", host); } break; - case "splithttp": - const splithttp = this.stream.splithttp; - params.set("path", splithttp.path); - params.set("host", splithttp.host); - const splithttpIndex = splithttp.headers.findIndex(header => header.name.toLowerCase() === 'host'); - if (splithttpIndex >= 0) { - const host = splithttp.headers[splithttpIndex].value; + case "xhttp": + const xhttp = this.stream.xhttp; + params.set("path", xhttp.path); + params.set("host", xhttp.host); + const xhttpIndex = xhttp.headers.findIndex(header => header.name.toLowerCase() === 'host'); + if (xhttpIndex >= 0) { + const host = xhttp.headers[xhttpIndex].value; params.set("host", host); }; - params.set("mode", splithttp.mode); + params.set("mode", xhttp.mode); break; } @@ -1627,16 +1628,16 @@ class Inbound extends XrayCommonClass { params.set("host", host); } break; - case "splithttp": - const splithttp = this.stream.splithttp; - params.set("path", splithttp.path); - params.set("host", splithttp.host); - const splithttpIndex = splithttp.headers.findIndex(header => header.name.toLowerCase() === 'host'); - if (splithttpIndex >= 0) { - const host = splithttp.headers[splithttpIndex].value; + case "xhttp": + const xhttp = this.stream.xhttp; + params.set("path", xhttp.path); + params.set("host", xhttp.host); + const xhttpIndex = xhttp.headers.findIndex(header => header.name.toLowerCase() === 'host'); + if (xhttpIndex >= 0) { + const host = xhttp.headers[xhttpIndex].value; params.set("host", host); }; - params.set("mode", splithttp.mode); + params.set("mode", xhttp.mode); break; } @@ -1750,16 +1751,16 @@ class Inbound extends XrayCommonClass { params.set("host", host); } break; - case "splithttp": - const splithttp = this.stream.splithttp; - params.set("path", splithttp.path); - params.set("host", splithttp.host); - const splithttpIndex = splithttp.headers.findIndex(header => header.name.toLowerCase() === 'host'); - if (splithttpIndex >= 0) { - const host = splithttp.headers[splithttpIndex].value; + case "xhttp": + const xhttp = this.stream.xhttp; + params.set("path", xhttp.path); + params.set("host", xhttp.host); + const xhttpIndex = xhttp.headers.findIndex(header => header.name.toLowerCase() === 'host'); + if (xhttpIndex >= 0) { + const host = xhttp.headers[xhttpIndex].value; params.set("host", host); }; - params.set("mode", splithttp.mode); + params.set("mode", xhttp.mode); break; } diff --git a/web/html/xui/form/stream/stream_settings.html b/web/html/xui/form/stream/stream_settings.html index fd847b8..ef02a39 100644 --- a/web/html/xui/form/stream/stream_settings.html +++ b/web/html/xui/form/stream/stream_settings.html @@ -10,7 +10,7 @@ http grpc HTTPUpgrade - SplitHTTP + xHTTP @@ -50,9 +50,9 @@ {{template "form/streamHTTPUpgrade"}} - -