fix #225
This commit is contained in:
parent
6afb0a8f59
commit
5cf657773f
14
handler.go
14
handler.go
@ -95,8 +95,18 @@ func (h *autoHandler) Handle(conn net.Conn) {
|
||||
cc := &bufferdConn{Conn: conn, br: br}
|
||||
switch b[0] {
|
||||
case gosocks4.Ver4:
|
||||
cc.Close()
|
||||
return // SOCKS4(a) does not suppport authentication method, so we ignore it for security reason.
|
||||
options := &HandlerOptions{}
|
||||
for _, opt := range h.options {
|
||||
opt(options)
|
||||
}
|
||||
// SOCKS4(a) does not suppport authentication method,
|
||||
// so we ignore it when credentials are specified for security reason.
|
||||
if len(options.Users) > 0 {
|
||||
cc.Close()
|
||||
return
|
||||
}
|
||||
h := &socks4Handler{options}
|
||||
h.Handle(cc)
|
||||
case gosocks5.Ver5:
|
||||
SOCKS5Handler(h.options...).Handle(cc)
|
||||
default: // http
|
||||
|
Loading…
Reference in New Issue
Block a user