DDoS防护增加秒级连接速率限制

This commit is contained in:
刘祥超
2022-08-31 10:01:00 +08:00
parent 5c885050fa
commit b6fe3df3d6
3 changed files with 33 additions and 30 deletions

View File

@@ -7,11 +7,14 @@ type TCPConfig struct {
IsOn bool `json:"isOn"`
MaxConnections int32 `json:"maxConnections"`
MaxConnectionsPerIP int32 `json:"maxConnectionsPerIP"`
NewConnectionsRate int32 `json:"newConnectionsRate"`
// 自动加入黑名单连接速率
DenyNewConnectionsRate int32 `json:"denyNewConnectionsRate"`
DenyNewConnectionsRateTimeout int32 `json:"denyNewConnectionsRateTimeout"`
// 分钟级速率
NewConnectionsMinutelyRate int32 `json:"newConnectionsRate"` // 分钟
NewConnectionsMinutelyRateBlockTimeout int32 `json:"newConnectionsRateBlockTimeout"` // 拦截时间
// 秒级速率
NewConnectionsSecondlyRate int32 `json:"newConnectionsSecondlyRate"`
NewConnectionsSecondlyRateBlockTimeout int32 `json:"newConnectionsSecondlyRateBlockTimeout"`
AllowIPList []*IPConfig `json:"allowIPList"`
Ports []*PortConfig `json:"ports"`