mKCP transport: Add cwndMultiplier

Replace legacy KCP buffer options with cwndMultiplier and maxSendingWindow across models and UI. Updated KcpStreamSettings in web/assets/js/model/inbound.js and web/assets/js/model/outbound.js (constructor, fromJson and toJson) to remove congestion/readBuffer/writeBuffer and use cwndMultiplier/maxSendingWindow instead. Updated web/html/form/outbound.html to reflect the new KCP fields in the stream form and to include extensive template formatting/markup cleanup for consistency and readability.
This commit is contained in:
MHSanaei 2026-04-20 17:45:14 +02:00
parent 6d0e7ec495
commit 86304226a9
No known key found for this signature in database
GPG key ID: 7E4060F2FBE5AB7A
4 changed files with 787 additions and 333 deletions

View file

@ -323,18 +323,16 @@ class KcpStreamSettings extends XrayCommonClass {
tti = 20, tti = 20,
uplinkCapacity = 5, uplinkCapacity = 5,
downlinkCapacity = 20, downlinkCapacity = 20,
congestion = false, cwndMultiplier = 0,
readBufferSize = 1, maxSendingWindow = 0,
writeBufferSize = 1,
) { ) {
super(); super();
this.mtu = mtu; this.mtu = mtu;
this.tti = tti; this.tti = tti;
this.upCap = uplinkCapacity; this.upCap = uplinkCapacity;
this.downCap = downlinkCapacity; this.downCap = downlinkCapacity;
this.congestion = congestion; this.cwndMultiplier = cwndMultiplier;
this.readBuffer = readBufferSize; this.maxSendingWindow = maxSendingWindow;
this.writeBuffer = writeBufferSize;
} }
static fromJson(json = {}) { static fromJson(json = {}) {
@ -343,9 +341,8 @@ class KcpStreamSettings extends XrayCommonClass {
json.tti, json.tti,
json.uplinkCapacity, json.uplinkCapacity,
json.downlinkCapacity, json.downlinkCapacity,
json.congestion, json.cwndMultiplier,
json.readBufferSize, json.maxSendingWindow,
json.writeBufferSize,
); );
} }
@ -355,9 +352,8 @@ class KcpStreamSettings extends XrayCommonClass {
tti: this.tti, tti: this.tti,
uplinkCapacity: this.upCap, uplinkCapacity: this.upCap,
downlinkCapacity: this.downCap, downlinkCapacity: this.downCap,
congestion: this.congestion, cwndMultiplier: this.cwndMultiplier,
readBufferSize: this.readBuffer, maxSendingWindow: this.maxSendingWindow,
writeBufferSize: this.writeBuffer,
}; };
} }
} }

View file

@ -169,18 +169,16 @@ class KcpStreamSettings extends CommonClass {
tti = 20, tti = 20,
uplinkCapacity = 5, uplinkCapacity = 5,
downlinkCapacity = 20, downlinkCapacity = 20,
congestion = false, cwndMultiplier = 0,
readBufferSize = 1, maxSendingWindow = 0,
writeBufferSize = 1,
) { ) {
super(); super();
this.mtu = mtu; this.mtu = mtu;
this.tti = tti; this.tti = tti;
this.upCap = uplinkCapacity; this.upCap = uplinkCapacity;
this.downCap = downlinkCapacity; this.downCap = downlinkCapacity;
this.congestion = congestion; this.cwndMultiplier = cwndMultiplier;
this.readBuffer = readBufferSize; this.maxSendingWindow = maxSendingWindow;
this.writeBuffer = writeBufferSize;
} }
static fromJson(json = {}) { static fromJson(json = {}) {
@ -189,9 +187,8 @@ class KcpStreamSettings extends CommonClass {
json.tti, json.tti,
json.uplinkCapacity, json.uplinkCapacity,
json.downlinkCapacity, json.downlinkCapacity,
json.congestion, json.cwndMultiplier,
json.readBufferSize, json.maxSendingWindow,
json.writeBufferSize,
); );
} }
@ -201,9 +198,8 @@ class KcpStreamSettings extends CommonClass {
tti: this.tti, tti: this.tti,
uplinkCapacity: this.upCap, uplinkCapacity: this.upCap,
downlinkCapacity: this.downCap, downlinkCapacity: this.downCap,
congestion: this.congestion, cwndMultiplier: this.cwndMultiplier,
readBufferSize: this.readBuffer, maxSendingWindow: this.maxSendingWindow,
writeBufferSize: this.writeBuffer,
}; };
} }
} }

File diff suppressed because it is too large Load diff

View file

@ -30,18 +30,15 @@
:min="0" :min="0"
></a-input-number> ></a-input-number>
</a-form-item> </a-form-item>
<a-form-item label="Congestion"> <a-form-item label="CWND Multiplier">
<a-switch v-model="inbound.stream.kcp.congestion"></a-switch>
</a-form-item>
<a-form-item label="Read Buffer (MB)">
<a-input-number <a-input-number
v-model.number="inbound.stream.kcp.readBuffer" v-model.number="inbound.stream.kcp.cwndMultiplier"
:min="0" :min="0"
></a-input-number> ></a-input-number>
</a-form-item> </a-form-item>
<a-form-item label="Write Buffer (MB)"> <a-form-item label="Max Sending Window">
<a-input-number <a-input-number
v-model.number="inbound.stream.kcp.writeBuffer" v-model.number="inbound.stream.kcp.maxSendingWindow"
:min="0" :min="0"
></a-input-number> ></a-input-number>
</a-form-item> </a-form-item>