accept -socks and -proxy
parent
4559e269e0
commit
83e848f262
|
|
@ -15,6 +15,8 @@ type Config struct {
|
||||||
TLSInsecure bool
|
TLSInsecure bool
|
||||||
Limiter *rate.Limiter
|
Limiter *rate.Limiter
|
||||||
DNS string
|
DNS string
|
||||||
|
Socks bool
|
||||||
|
Proxy string
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewConfig() *Config {
|
func NewConfig() *Config {
|
||||||
|
|
@ -23,9 +25,11 @@ func NewConfig() *Config {
|
||||||
as.Append(args.INT, "p", "port to listen on", 61113)
|
as.Append(args.INT, "p", "port to listen on", 61113)
|
||||||
as.Append(args.INT, "kbps", "kilobytes per sec limit", -1)
|
as.Append(args.INT, "kbps", "kilobytes per sec limit", -1)
|
||||||
as.Append(args.BOOL, "tls-insecure", "permit tls insecure", false)
|
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.DURATION, "t", "timeout", time.Minute)
|
||||||
|
|
||||||
as.Append(args.STRING, "dns", "dns ip:port", "1.1.1.1:53")
|
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 {
|
if err := as.Parse(); err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
|
@ -43,5 +47,7 @@ func NewConfig() *Config {
|
||||||
TLSInsecure: as.GetBool("tls-insecure"),
|
TLSInsecure: as.GetBool("tls-insecure"),
|
||||||
Limiter: limiter,
|
Limiter: limiter,
|
||||||
DNS: as.GetString("dns"),
|
DNS: as.GetString("dns"),
|
||||||
|
Socks: as.GetBool("socks"),
|
||||||
|
Proxy: as.GetString("proxy"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue