Support using proxy dial-up connection to GitHub. (#46)
This commit is contained in:
@@ -13,6 +13,7 @@ type Config struct {
|
||||
Blacklist BlacklistConfig
|
||||
Whitelist WhitelistConfig
|
||||
RateLimit RateLimitConfig
|
||||
Proxy ProxyConfig
|
||||
}
|
||||
|
||||
type ServerConfig struct {
|
||||
@@ -62,6 +63,11 @@ type RateLimitConfig struct {
|
||||
Burst int `toml:"burst"`
|
||||
}
|
||||
|
||||
type ProxyConfig struct {
|
||||
Enabled bool `toml:"enabled"`
|
||||
Url string `toml:"url"`
|
||||
}
|
||||
|
||||
// LoadConfig 从 TOML 配置文件加载配置
|
||||
func LoadConfig(filePath string) (*Config, error) {
|
||||
var config Config
|
||||
|
||||
@@ -36,3 +36,7 @@ enabled = false
|
||||
rateMethod = "total" # "ip" or "total"
|
||||
ratePerMinute = 180
|
||||
burst = 5
|
||||
|
||||
[proxy]
|
||||
enabled = false
|
||||
url = "socks5://127.0.0.1:1080" # "http://127.0.0.1:7890"
|
||||
Reference in New Issue
Block a user