This commit is contained in:
DHR60 2026-04-15 19:12:59 +08:00 committed by GitHub
commit d36565626b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 10 additions and 14 deletions

View file

@ -77,10 +77,11 @@ public static class ConfigHandler
Tti = 50, Tti = 50,
UplinkCapacity = 12, UplinkCapacity = 12,
DownlinkCapacity = 100, DownlinkCapacity = 100,
ReadBufferSize = 2, CwndMultiplier = 1,
WriteBufferSize = 2, MaxSendingWindow = 2 * 1024 * 1024,
Congestion = false
}; };
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 config.GrpcItem ??= new GrpcItem
{ {
IdleTimeout = 60, IdleTimeout = 60,

View file

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

View file

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

View file

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