diff --git a/config.go b/config.go index 088771b..fe68ea1 100644 --- a/config.go +++ b/config.go @@ -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"), } }