remove SOCKS4 suppport for auto handler
This commit is contained in:
parent
8cbd2722f6
commit
5869a51585
@ -117,11 +117,12 @@ scheme://[bind_address]:port/[host]:hostport
|
|||||||
"ChainNodes": [
|
"ChainNodes": [
|
||||||
"http://192.168.1.1:8080",
|
"http://192.168.1.1:8080",
|
||||||
"https://10.0.2.1:443"
|
"https://10.0.2.1:443"
|
||||||
]
|
],
|
||||||
|
"Debug": true
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
ServeNodes等同于-L参数,ChainNodes等同于-F参数
|
`ServeNodes`等同于`-L`参数,`ChainNodes`等同于`-F`参数,`Debug`等同于`-D`参数。
|
||||||
|
|
||||||
|
|
||||||
使用方法
|
使用方法
|
||||||
|
@ -117,11 +117,12 @@ The configuration file is in standard JSON format:
|
|||||||
"ChainNodes": [
|
"ChainNodes": [
|
||||||
"http://192.168.1.1:8080",
|
"http://192.168.1.1:8080",
|
||||||
"https://10.0.2.1:443"
|
"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
|
Usage
|
||||||
------
|
------
|
||||||
|
@ -24,7 +24,7 @@ import (
|
|||||||
var (
|
var (
|
||||||
options struct {
|
options struct {
|
||||||
ChainNodes, ServeNodes stringList
|
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.ChainNodes, "F", "forward address, can make a forward chain")
|
||||||
flag.Var(&options.ServeNodes, "L", "listen address, can listen on multiple ports")
|
flag.Var(&options.ServeNodes, "L", "listen address, can listen on multiple ports")
|
||||||
flag.StringVar(&configureFile, "C", "", "configure file")
|
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.BoolVar(&printVersion, "V", false, "print version")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
@ -57,7 +57,7 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
gost.SetLogger(&gost.LogLogger{})
|
gost.SetLogger(&gost.LogLogger{})
|
||||||
gost.Debug = options.DebugMode
|
gost.Debug = options.Debug
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
@ -96,7 +96,7 @@ func (h *autoHandler) Handle(conn net.Conn) {
|
|||||||
cc := &bufferdConn{Conn: conn, br: br}
|
cc := &bufferdConn{Conn: conn, br: br}
|
||||||
switch b[0] {
|
switch b[0] {
|
||||||
case gosocks4.Ver4:
|
case gosocks4.Ver4:
|
||||||
SOCKS4Handler(h.options...).Handle(cc)
|
return // SOCKS4(a) does not suppport authentication method, so we ignore it.
|
||||||
case gosocks5.Ver5:
|
case gosocks5.Ver5:
|
||||||
SOCKS5Handler(h.options...).Handle(cc)
|
SOCKS5Handler(h.options...).Handle(cc)
|
||||||
default: // http
|
default: // http
|
||||||
|
Loading…
Reference in New Issue
Block a user