mirror of
https://github.com/xvzc/SpoofDPI.git
synced 2025-01-02 20:40:21 +00:00
chore: add quiet option to arguments (#234)
* feat: add quiet option to arguments * docs: fit docs to new feature * chore: rename the quiet option to silent, fix docs * docs: remove mentions of the banner option * feat!: remove the banner option BREAKING CHANGES: the banner option is no longer supported * chore: remove the useless PrintSimpleInfo function * docs: improve the wording of the silent option
This commit is contained in:
parent
78b9cdb3c2
commit
786d31cbb7
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -29,10 +29,8 @@ func main() {
|
||||
|
||||
pxy := proxy.New(config)
|
||||
|
||||
if config.Banner {
|
||||
if !config.Silent {
|
||||
util.PrintColoredBanner()
|
||||
} else {
|
||||
util.PrintSimpleInfo()
|
||||
}
|
||||
|
||||
if config.SystemProxy {
|
||||
|
@ -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,
|
||||
|
@ -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("")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user