Skip to content

Commit

Permalink
添加 SplitHTTP xmux
Browse files Browse the repository at this point in the history
  • Loading branch information
qist committed Sep 19, 2024
1 parent f761609 commit 02a520d
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 11 deletions.
2 changes: 1 addition & 1 deletion config/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
24.9.9
24.9.19
4 changes: 2 additions & 2 deletions 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.20240908221010-1f2931903976
github.com/xtls/xray-core v1.8.25-0.20240919011229-bc28cad8f87a
go.uber.org/atomic v1.11.0
golang.org/x/crypto v0.27.0
golang.org/x/text v0.18.0
Expand Down Expand Up @@ -49,7 +49,7 @@ require (
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/pires/go-proxyproto v0.7.0 // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
github.com/sagernet/sing v0.4.1 // indirect
github.com/sagernet/sing v0.4.3 // indirect
github.com/shoenig/go-m1cpu v0.1.6 // indirect
github.com/tklauser/go-sysconf v0.3.12 // indirect
github.com/tklauser/numcpus v0.6.1 // indirect
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3 h1:f/FNXud6gA3MNr
github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3/go.mod h1:HgjTstvQsPGkxUsCd2KWxErBblirPizecHcpD3ffK+s=
github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs=
github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro=
github.com/sagernet/sing v0.4.1 h1:zVlpE+7k7AFoC2pv6ReqLf0PIHjihL/jsBl5k05PQFk=
github.com/sagernet/sing v0.4.1/go.mod h1:ieZHA/+Y9YZfXs2I3WtuwgyCZ6GPsIR7HdKb1SdEnls=
github.com/sagernet/sing v0.4.3 h1:Ty/NAiNnVd6844k7ujlL5lkzydhcTH5Psc432jXA4Y8=
github.com/sagernet/sing v0.4.3/go.mod h1:ieZHA/+Y9YZfXs2I3WtuwgyCZ6GPsIR7HdKb1SdEnls=
github.com/sagernet/sing-shadowsocks v0.2.7 h1:zaopR1tbHEw5Nk6FAkM05wCslV6ahVegEZaKMv9ipx8=
github.com/sagernet/sing-shadowsocks v0.2.7/go.mod h1:0rIKJZBR65Qi0zwdKezt4s57y/Tl1ofkaq6NlkzVuyE=
github.com/seiflotfy/cuckoofilter v0.0.0-20240715131351-a2f2c23f1771 h1:emzAzMZ1L9iaKCTxdy3Em8Wv4ChIAGnfiz18Cda70g4=
Expand Down Expand Up @@ -161,8 +161,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.20240908221010-1f2931903976 h1:rde4VXWBEgpDGTy9ZWdANRT0jIZJ5qnZiBEfvBS/XlM=
github.com/xtls/xray-core v1.8.25-0.20240908221010-1f2931903976/go.mod h1:fJZjuOpUJXPMrZj7agA8lMkz34U2ziEybL/+ABblwE8=
github.com/xtls/xray-core v1.8.25-0.20240919011229-bc28cad8f87a h1:jpitqUboMi5YXGPDgi0vDajThRprtZ/nhjUBn0JuduU=
github.com/xtls/xray-core v1.8.25-0.20240919011229-bc28cad8f87a/go.mod h1:l03adDk7IwHvIoRHNKQWI3SGIq/96RFP95/rDHk++30=
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
20 changes: 17 additions & 3 deletions web/assets/js/model/xray.js
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,13 @@ class SplitHTTPStreamSettings extends XrayCommonClass {
scMaxConcurrentPosts = 100,
scMinPostsIntervalMs = 30,
noSSEHeader = false,
xPaddingBytes = "100-1000"
xPaddingBytes = "100-1000",
xmux = {
maxConnections: 0,
maxConcurrency: 0,
cMaxReuseTimes: 0,
cMaxLifetimeMs: 0
}
) {
super();
this.path = path;
Expand All @@ -533,7 +539,8 @@ class SplitHTTPStreamSettings extends XrayCommonClass {
this.scMaxConcurrentPosts = scMaxConcurrentPosts;
this.scMinPostsIntervalMs = scMinPostsIntervalMs;
this.noSSEHeader = noSSEHeader;
this.xPaddingBytes = RandomUtil.convertXPaddingBytes(xPaddingBytes);
this.xPaddingBytes = RandomUtil.convertXPaddingBytes(xPaddingBytes);
this.xmux = xmux;
}

addHeader(name, value) {
Expand All @@ -560,7 +567,8 @@ class SplitHTTPStreamSettings extends XrayCommonClass {
json.scMaxConcurrentPosts,
json.scMinPostsIntervalMs,
json.noSSEHeader,
json.xPaddingBytes
json.xPaddingBytes,
json.xmux,
);
}

Expand All @@ -574,6 +582,12 @@ class SplitHTTPStreamSettings extends XrayCommonClass {
scMinPostsIntervalMs: this.scMinPostsIntervalMs,
noSSEHeader: this.noSSEHeader,
xPaddingBytes: RandomUtil.convertXPaddingBytes(this.xPaddingBytes),
xmux: {
maxConnections: this.xmux.maxConnections,
maxConcurrency: this.xmux.maxConcurrency,
cMaxReuseTimes: this.xmux.cMaxReuseTimes,
cMaxLifetimeMs: this.xmux.cMaxLifetimeMs
}
};
}
}
Expand Down
14 changes: 13 additions & 1 deletion web/html/xui/form/stream/stream_splithttp.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,19 @@
<a-icon type="question-circle" theme="filled"></a-icon>
</a-tooltip>
</span>
<a-input v-model.trim="inbound.stream.splithttp.xPaddingBytes" style="width: 165px"></a-input>
<a-input v-model.trim="inbound.stream.splithttp.xPaddingBytes" style="width: 100px"></a-input>
</a-form-item>
<a-form-item label="Max Connections">
<a-input-number v-model.trim="inbound.stream.splithttp.xmux.maxConnections" :min="0"></a-input-number>
</a-form-item>
<a-form-item label="Max Concurrency">
<a-input-number v-model.trim="inbound.stream.splithttp.xmux.maxConcurrency" :min="0"></a-input-number>
</a-form-item>
<a-form-item label="Max Reuse Times">
<a-input-number v-model.trim="inbound.stream.splithttp.xmux.cMaxReuseTimes" :min="0"></a-input-number>
</a-form-item>
<a-form-item label="Max Lifetime (ms)">
<a-input-number v-model.trim="inbound.stream.splithttp.xmux.cMaxLifetimeMs" :min="0"></a-input-number>
</a-form-item>
</a-form>
{{end}}

0 comments on commit 02a520d

Please sign in to comment.