mirror of
https://github.com/WJQSERVER-STUDIO/ghproxy.git
synced 2026-02-03 16:21:11 +08:00
Support using proxy dial-up connection to GitHub.
This commit is contained in:
parent
f5c32915b9
commit
c7aea91c43
8 changed files with 80 additions and 9 deletions
|
|
@ -13,6 +13,7 @@ type Config struct {
|
|||
Blacklist BlacklistConfig
|
||||
Whitelist WhitelistConfig
|
||||
RateLimit RateLimitConfig
|
||||
Proxy ProxyConfig
|
||||
}
|
||||
|
||||
type ServerConfig struct {
|
||||
|
|
@ -61,6 +62,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
|
||||
|
|
|
|||
|
|
@ -35,3 +35,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"
|
||||
Loading…
Add table
Add a link
Reference in a new issue