diff --git a/README.md b/README.md index 423ab01..89ec1cd 100644 --- a/README.md +++ b/README.md @@ -18,8 +18,6 @@ See the installation guide for SpoofDPI [here](https://github.com/xvzc/SpoofDPI/ Usage: spoofdpi [options...] -addr string listen address (default "127.0.0.1") - -banner - enable banner (default true) -debug enable debug output -dns-addr string @@ -32,6 +30,8 @@ Usage: spoofdpi [options...] bypass DPI only on packets matching this regex pattern; can be given multiple times -port int port (default 8080) + -silent + do not show the banner and server information at start up -system-proxy enable system-wide proxy (default true) -timeout int diff --git a/_docs/README_ja.md b/_docs/README_ja.md index c009e57..3aad659 100644 --- a/_docs/README_ja.md +++ b/_docs/README_ja.md @@ -19,8 +19,6 @@ See the installation guide for SpoofDPI [here](https://github.com/xvzc/SpoofDPI/ Usage: spoofdpi [options...] -addr string listen address (default "127.0.0.1") - -banner - enable banner (default true) -debug enable debug output -dns-addr string @@ -33,6 +31,8 @@ Usage: spoofdpi [options...] bypass DPI only on packets matching this regex pattern; can be given multiple times -port int port (default 8080) + -silent + do not show the banner and server information at start up -system-proxy enable system-wide proxy (default true) -timeout int diff --git a/_docs/README_ko.md b/_docs/README_ko.md index 6a56335..f020c0f 100644 --- a/_docs/README_ko.md +++ b/_docs/README_ko.md @@ -19,8 +19,6 @@ SpoofDPI의 설치과정은 [여기](https://github.com/xvzc/SpoofDPI/blob/main/ Usage: spoofdpi [options...] -addr string listen address (default "127.0.0.1") - -banner - enable banner (default true) -debug enable debug output -dns-addr string @@ -33,6 +31,8 @@ Usage: spoofdpi [options...] bypass DPI only on packets matching this regex pattern; can be given multiple times -port int port (default 8080) + -silent + do not show the banner and server information at start up -system-proxy enable system-wide proxy (default true) -timeout int diff --git a/_docs/README_ru.md b/_docs/README_ru.md index 072277f..f3c9809 100644 --- a/_docs/README_ru.md +++ b/_docs/README_ru.md @@ -18,8 +18,6 @@ Usage: spoofdpi [опции...] -addr string listen address (default "127.0.0.1") - -banner - enable banner (default true) -debug enable debug output -dns-addr string @@ -32,6 +30,8 @@ Usage: spoofdpi [опции...] bypass DPI only on packets matching this regex pattern; can be given multiple times -port int port (default 8080) + -silent + do not show the banner and server information at start up -system-proxy enable system-wide proxy (default true) -timeout int diff --git a/_docs/README_zh-cn.md b/_docs/README_zh-cn.md index 897946c..4adfa49 100644 --- a/_docs/README_zh-cn.md +++ b/_docs/README_zh-cn.md @@ -21,8 +21,6 @@ See the installation guide for SpoofDPI [here](https://github.com/xvzc/SpoofDPI/ Usage: spoofdpi [options...] -addr string listen address (default "127.0.0.1") - -banner - enable banner (default true) -debug enable debug output -dns-addr string @@ -35,6 +33,8 @@ Usage: spoofdpi [options...] bypass DPI only on packets matching this regex pattern; can be given multiple times -port int port (default 8080) + -silent + do not show the banner and server information at start up -system-proxy enable system-wide proxy (default true) -timeout int diff --git a/cmd/spoofdpi/main.go b/cmd/spoofdpi/main.go index e4af8f8..3e8d088 100644 --- a/cmd/spoofdpi/main.go +++ b/cmd/spoofdpi/main.go @@ -29,10 +29,8 @@ func main() { pxy := proxy.New(config) - if config.Banner { + if !config.Silent { util.PrintColoredBanner() - } else { - util.PrintSimpleInfo() } if config.SystemProxy { diff --git a/util/args.go b/util/args.go index c592b98..2bfe72f 100644 --- a/util/args.go +++ b/util/args.go @@ -15,7 +15,7 @@ type Args struct { DnsPort uint16 EnableDoh bool Debug bool - Banner bool + Silent bool SystemProxy bool Timeout uint16 AllowedPattern StringArray @@ -43,7 +43,7 @@ func ParseArgs() *Args { uintNVar(&args.DnsPort, "dns-port", 53, "port number for dns") flag.BoolVar(&args.EnableDoh, "enable-doh", false, "enable 'dns-over-https'") flag.BoolVar(&args.Debug, "debug", false, "enable debug output") - flag.BoolVar(&args.Banner, "banner", true, "enable banner") + flag.BoolVar(&args.Silent, "silent", false, "do not show the banner and server information at start up") flag.BoolVar(&args.SystemProxy, "system-proxy", true, "enable system-wide proxy") uintNVar(&args.Timeout, "timeout", 0, "timeout in milliseconds; no timeout when not given") uintNVar(&args.WindowSize, "window-size", 0, `chunk size, in number of bytes, for fragmented client hello, diff --git a/util/config.go b/util/config.go index c6ec2a8..d58423b 100644 --- a/util/config.go +++ b/util/config.go @@ -15,7 +15,7 @@ type Config struct { DnsPort int EnableDoh bool Debug bool - Banner bool + Silent bool SystemProxy bool Timeout int WindowSize int @@ -38,7 +38,7 @@ func (c *Config) Load(args *Args) { c.DnsPort = int(args.DnsPort) c.Debug = args.Debug c.EnableDoh = args.EnableDoh - c.Banner = args.Banner + c.Silent = args.Silent c.SystemProxy = args.SystemProxy c.Timeout = int(args.Timeout) c.AllowedPatterns = parseAllowedPattern(args.AllowedPattern) @@ -69,14 +69,3 @@ func PrintColoredBanner() { pterm.DefaultBasicText.Println("Press 'CTRL + c' to quit") } - -func PrintSimpleInfo() { - fmt.Println("") - fmt.Println("- ADDR : ", config.Addr) - fmt.Println("- PORT : ", config.Port) - fmt.Println("- DNS : ", config.DnsAddr) - fmt.Println("- DEBUG : ", config.Debug) - fmt.Println("") - fmt.Println("Press 'CTRL + c to quit'") - fmt.Println("") -}