accept -socks and -proxy

master
bel 2023-04-15 15:10:38 -06:00
parent 4559e269e0
commit 83e848f262
1 changed files with 6 additions and 0 deletions

View File

@ -15,6 +15,8 @@ type Config struct {
TLSInsecure bool
Limiter *rate.Limiter
DNS string
Socks bool
Proxy string
}
func NewConfig() *Config {
@ -23,9 +25,11 @@ func NewConfig() *Config {
as.Append(args.INT, "p", "port to listen on", 61113)
as.Append(args.INT, "kbps", "kilobytes per sec limit", -1)
as.Append(args.BOOL, "tls-insecure", "permit tls insecure", false)
as.Append(args.BOOL, "socks", "accept socks instead", false)
as.Append(args.DURATION, "t", "timeout", time.Minute)
as.Append(args.STRING, "dns", "dns ip:port", "1.1.1.1:53")
as.Append(args.STRING, "proxy", "scheme://host:port to proxy proxied to", "")
if err := as.Parse(); err != nil {
panic(err)
@ -43,5 +47,7 @@ func NewConfig() *Config {
TLSInsecure: as.GetBool("tls-insecure"),
Limiter: limiter,
DNS: as.GetString("dns"),
Socks: as.GetBool("socks"),
Proxy: as.GetString("proxy"),
}
}