Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Support kcp cwndMultiplier
  • Loading branch information
DHR60 committed Apr 14, 2026
commit 993feb4b074f35ccbefeb9d99b57b7b42d5a5233
7 changes: 4 additions & 3 deletions v2rayN/ServiceLib/Handler/ConfigHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 2 additions & 4 deletions v2rayN/ServiceLib/Models/ConfigItems.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
6 changes: 2 additions & 4 deletions v2rayN/ServiceLib/Models/V2rayConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -431,9 +431,8 @@ private void FillBoundStreamSettings(Outbounds4Ray outbound)
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))
{
Expand Down