Support kcp cwndMultiplier

This commit is contained in:
DHR60 2026-04-14 22:43:22 +08:00
parent 43dcb90632
commit 993feb4b07
4 changed files with 10 additions and 14 deletions

View file

@ -77,10 +77,11 @@ public static class ConfigHandler
Tti = 50,
UplinkCapacity = 12,
DownlinkCapacity = 100,
ReadBufferSize = 2,
WriteBufferSize = 2,
Congestion = false
CwndMultiplier = 1,
MaxSendingWindow = 2 * 1024 * 1024,
};
config.KcpItem.CwndMultiplier = config.KcpItem.CwndMultiplier <= 0 ? 1 : config.KcpItem.CwndMultiplier;
config.KcpItem.MaxSendingWindow = config.KcpItem.MaxSendingWindow <= 0 ? (2 * 1024 * 1024) : config.KcpItem.MaxSendingWindow;
config.GrpcItem ??= new GrpcItem
{
IdleTimeout = 60,

View file

@ -49,11 +49,9 @@ public class KcpItem
public int DownlinkCapacity { get; set; }
public bool Congestion { get; set; }
public int CwndMultiplier { get; set; }
public int ReadBufferSize { get; set; }
public int WriteBufferSize { get; set; }
public int MaxSendingWindow { get; set; }
}
[Serializable]

View file

@ -397,11 +397,9 @@ public class KcpSettings4Ray
public int downlinkCapacity { get; set; }
public bool congestion { get; set; }
public int cwndMultiplier { get; set; }
public int readBufferSize { get; set; }
public int writeBufferSize { get; set; }
public int maxSendingWindow { get; set; }
}
public class WsSettings4Ray

View file

@ -431,9 +431,8 @@ public partial class CoreConfigV2rayService
kcpSettings.uplinkCapacity = _config.KcpItem.UplinkCapacity;
kcpSettings.downlinkCapacity = _config.KcpItem.DownlinkCapacity;
kcpSettings.congestion = _config.KcpItem.Congestion;
kcpSettings.readBufferSize = _config.KcpItem.ReadBufferSize;
kcpSettings.writeBufferSize = _config.KcpItem.WriteBufferSize;
kcpSettings.cwndMultiplier = _config.KcpItem.CwndMultiplier;
kcpSettings.maxSendingWindow = _config.KcpItem.MaxSendingWindow;
var kcpFinalmask = new Finalmask4Ray();
if (Global.KcpHeaderMaskMap.TryGetValue(_node.HeaderType, out var header))
{