Skip to content

Commit

Permalink
删除 http 谨慎更新
Browse files Browse the repository at this point in the history
  • Loading branch information
qist committed Dec 16, 2024
1 parent 3b68e52 commit 8043f9f
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 84 deletions.
2 changes: 1 addition & 1 deletion config/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
24.12.10
24.12.16
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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.20241207144338-9cb6816383dd
github.com/xtls/xray-core v1.8.25-0.20241215123619-7d0a80b501d4
go.uber.org/atomic v1.11.0
golang.org/x/crypto v0.31.0
golang.org/x/text v0.21.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,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.20241207144338-9cb6816383dd h1:jcGpaTPQUgFqCeG2Ek5Yj1fwVsoI4LcIDJNXuC2qMaA=
github.com/xtls/xray-core v1.8.25-0.20241207144338-9cb6816383dd/go.mod h1:jTHrem03qe2KEk7RttKZbHk0VdJDf0CWQ9B+/2FXNI0=
github.com/xtls/xray-core v1.8.25-0.20241215123619-7d0a80b501d4 h1:zdd86FEjFZjAaRbWxiZQM2QPOzk/d6cig2DaE7c3MDQ=
github.com/xtls/xray-core v1.8.25-0.20241215123619-7d0a80b501d4/go.mod h1:lduNPDkXku+Avphl8g7W0yJrHhWyxdOnPo0XGYdF0Aw=
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=
Expand Down
68 changes: 6 additions & 62 deletions web/assets/js/model/xray.js
Original file line number Diff line number Diff line change
Expand Up @@ -415,39 +415,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 = "",
Expand Down Expand Up @@ -540,6 +507,7 @@ class xHTTPStreamSettings extends XrayCommonClass {
},
mode = MODE_OPTION.AUTO,
noGRPCHeader = false,
keepAlivePeriod = 45,
) {
super();
this.path = path;
Expand All @@ -553,6 +521,7 @@ class xHTTPStreamSettings extends XrayCommonClass {
this.xmux = xmux;
this.mode = mode;
this.noGRPCHeader = noGRPCHeader;
this.keepAlivePeriod = keepAlivePeriod;
}

addHeader(name, value) {
Expand Down Expand Up @@ -582,7 +551,8 @@ class xHTTPStreamSettings extends XrayCommonClass {
json.xPaddingBytes,
json.xmux,
json.mode,
json.noGRPCHeader,
json.noGRPCHeader,
json.keepAlivePeriod,
);
}

Expand All @@ -608,6 +578,7 @@ class xHTTPStreamSettings extends XrayCommonClass {
xmux: xmuxData,
mode: this.mode,
noGRPCHeader: this.noGRPCHeader,
keepAlivePeriod: this.keepAlivePeriod,
};
}
}
Expand Down Expand Up @@ -906,7 +877,6 @@ class StreamSettings extends XrayCommonClass {
rawSettings = new TcpStreamSettings(),
kcpSettings = new KcpStreamSettings(),
wsSettings = new WsStreamSettings(),
httpSettings = new HttpStreamSettings(),
grpcSettings = new GrpcStreamSettings(),
httpupgradeSettings = new HttpUpgradeStreamSettings(),
xhttpSettings = new xHTTPStreamSettings(),
Expand All @@ -921,7 +891,6 @@ class StreamSettings extends XrayCommonClass {
this.raw = rawSettings;
this.kcp = kcpSettings;
this.ws = wsSettings;
this.http = httpSettings;
this.grpc = grpcSettings;
this.httpupgrade = httpupgradeSettings;
this.xhttp = xhttpSettings;
Expand Down Expand Up @@ -970,7 +939,6 @@ class StreamSettings extends XrayCommonClass {
TcpStreamSettings.fromJson(json.rawSettings),
KcpStreamSettings.fromJson(json.kcpSettings),
WsStreamSettings.fromJson(json.wsSettings),
HttpStreamSettings.fromJson(json.httpSettings),
GrpcStreamSettings.fromJson(json.grpcSettings),
HttpUpgradeStreamSettings.fromJson(json.httpupgradeSettings),
xHTTPStreamSettings.fromJson(json.xhttpSettings),
Expand All @@ -989,7 +957,6 @@ class StreamSettings extends XrayCommonClass {
rawSettings: network === 'raw' ? this.raw.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,
Expand Down Expand Up @@ -1104,9 +1071,6 @@ class Inbound extends XrayCommonClass {
return this.network === "grpc";
}

get isH2() {
return this.network === "http";
}
get isHttpupgrade() {
return this.network === "httpupgrade";
}
Expand Down Expand Up @@ -1241,7 +1205,6 @@ class Inbound extends XrayCommonClass {
case "tcp":
case "raw":
case "ws":
case "http":
case "grpc":
case "httpupgrade":
case "xhttp":
Expand All @@ -1263,7 +1226,7 @@ class Inbound extends XrayCommonClass {
default:
return false;
}
return ['tcp', 'raw', 'http', 'grpc', 'httpupgrade', 'xhttp'].indexOf(this.network) !== -1;
return ['tcp', 'raw', 'grpc', 'httpupgrade', 'xhttp'].indexOf(this.network) !== -1;
//return this.network === "tcp";
}

Expand Down Expand Up @@ -1359,10 +1322,6 @@ class Inbound extends XrayCommonClass {
if (index >= 0) {
host = ws.headers[index].value;
}
} else if (network === 'http') {
network = 'h2';
path = this.stream.http.path;
host = this.stream.http.host.join(',');
} else if (network === 'grpc') {
path = this.stream.grpc.serviceName;
authority = this.stream.grpc.authority;
Expand Down Expand Up @@ -1467,11 +1426,6 @@ class Inbound extends XrayCommonClass {
params.set("host", 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);
Expand Down Expand Up @@ -1605,11 +1559,6 @@ class Inbound extends XrayCommonClass {
params.set("host", 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);
Expand Down Expand Up @@ -1728,11 +1677,6 @@ class Inbound extends XrayCommonClass {
params.set("host", 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);
Expand Down
12 changes: 0 additions & 12 deletions web/html/xui/form/stream/stream_http.html

This file was deleted.

6 changes: 0 additions & 6 deletions web/html/xui/form/stream/stream_settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<a-select-option value="raw">raw</a-select-option>
<a-select-option value="kcp">kcp</a-select-option>
<a-select-option value="ws">ws</a-select-option>
<a-select-option value="http">http</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="xhttp">xHTTP</a-select-option>
Expand Down Expand Up @@ -35,11 +34,6 @@
{{template "form/streamWS"}}
</template>

<!-- http -->
<template v-if="inbound.stream.network === 'http'">
{{template "form/streamHTTP"}}
</template>

<!-- grpc -->
<template v-if="inbound.stream.network === 'grpc'">
{{template "form/streamGRPC"}}
Expand Down
3 changes: 3 additions & 0 deletions web/html/xui/form/stream/stream_xhttp.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
<a-select-option v-for="key in MODE_OPTION" :value="key">[[ key ]]</a-select-option>
</a-se-chlect>
</a-form-item>
<a-form-item label='keep-Alive Period'>
<a-input-number v-model.number="inbound.stream.xhttp.keepAlivePeriod"></a-input-number>
</a-form-item>
<a-form-item label="Max Concurrent Upload">
<a-input-number v-model="inbound.stream.xhttp.scMaxConcurrentPosts" :min="0"></a-input-number>
</a-form-item>
Expand Down

1 comment on commit 8043f9f

@junlongzzz
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

最新的 24.12.15 版本将 keepAlivePeriod 移至 xmux 内并更名了,还新增了参数

参数 scMaxConcurrentPosts 更改为 scMaxBufferedPosts

XTLS/Xray-core@73e0d4a

另外问一句有没有一个节点加多用户的打算

Please sign in to comment.