Browse Source

remove SOCKS4 suppport for auto handler

pull/176/head
rui.zheng 9 years ago
parent
commit
5869a51585
  1. 5
      README.md
  2. 5
      README_en.md
  3. 6
      cmd/gost/main.go
  4. 2
      handler.go

5
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`参数。
使用方法

5
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
------

6
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() {

2
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

Loading…
Cancel
Save