diff --git a/README.md b/README.md index 35433f3..12aff13 100644 --- a/README.md +++ b/README.md @@ -117,11 +117,12 @@ scheme://[bind_address]:port/[host]:hostport "ChainNodes": [ "http://192.168.1.1:8080", "https://10.0.2.1:443" - ] + ], + "Debug": true } ``` -ServeNodes等同于-L参数,ChainNodes等同于-F参数 +`ServeNodes`等同于`-L`参数,`ChainNodes`等同于`-F`参数,`Debug`等同于`-D`参数。 使用方法 diff --git a/README_en.md b/README_en.md index a245615..d8c8889 100644 --- a/README_en.md +++ b/README_en.md @@ -117,11 +117,12 @@ The configuration file is in standard JSON format: "ChainNodes": [ "http://192.168.1.1:8080", "https://10.0.2.1:443" - ] + ], + "Debug": true } ``` -ServeNodes is equivalent to the -L parameter, ChainNodes is equivalent to the -F parameter. +`ServeNodes` is equivalent to the `-L` parameter, `ChainNodes` is equivalent to the `-F` parameter, `Debug` is equivalent to the `-D` parameter. Usage ------ diff --git a/cmd/gost/main.go b/cmd/gost/main.go index a39248f..51f9eab 100644 --- a/cmd/gost/main.go +++ b/cmd/gost/main.go @@ -24,7 +24,7 @@ import ( var ( options struct { ChainNodes, ServeNodes stringList - DebugMode bool + Debug bool } ) @@ -37,7 +37,7 @@ func init() { flag.Var(&options.ChainNodes, "F", "forward address, can make a forward chain") flag.Var(&options.ServeNodes, "L", "listen address, can listen on multiple ports") flag.StringVar(&configureFile, "C", "", "configure file") - flag.BoolVar(&options.DebugMode, "D", false, "enable debug log") + flag.BoolVar(&options.Debug, "D", false, "enable debug log") flag.BoolVar(&printVersion, "V", false, "print version") flag.Parse() @@ -57,7 +57,7 @@ func init() { } gost.SetLogger(&gost.LogLogger{}) - gost.Debug = options.DebugMode + gost.Debug = options.Debug } func main() { diff --git a/handler.go b/handler.go index 4a454a0..451c4a6 100644 --- a/handler.go +++ b/handler.go @@ -96,7 +96,7 @@ func (h *autoHandler) Handle(conn net.Conn) { cc := &bufferdConn{Conn: conn, br: br} switch b[0] { case gosocks4.Ver4: - SOCKS4Handler(h.options...).Handle(cc) + return // SOCKS4(a) does not suppport authentication method, so we ignore it. case gosocks5.Ver5: SOCKS5Handler(h.options...).Handle(cc) default: // http