This commit is contained in:
WJQSERVER 2024-11-23 12:25:17 +08:00
parent 0ce5c2c11c
commit 32584f9516
10 changed files with 97 additions and 10 deletions

View file

@ -53,9 +53,10 @@ type WhitelistConfig struct {
}
type RateLimitConfig struct {
Enabled bool `toml:"enabled"`
RatePerMinute int `toml:"ratePerMinute"`
Burst int `toml:"burst"`
Enabled bool `toml:"enabled"`
RateMethod string `toml:"rateMethod"`
RatePerMinute int `toml:"ratePerMinute"`
Burst int `toml:"burst"`
}
// LoadConfig 从 TOML 配置文件加载配置

View file

@ -30,5 +30,6 @@ whitelistFile = "/data/ghproxy/config/whitelist.json"
[rateLimit]
enabled = false
rateMrthod = "total" # "ip" or "total"
ratePerMinute = 180
burst = 5