This commit is contained in:
zhengrui 2018-03-18 09:50:49 +08:00
parent 6afb0a8f59
commit 5cf657773f

View File

@ -95,8 +95,18 @@ 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:
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() cc.Close()
return // SOCKS4(a) does not suppport authentication method, so we ignore it for security reason. return
}
h := &socks4Handler{options}
h.Handle(cc)
case gosocks5.Ver5: case gosocks5.Ver5:
SOCKS5Handler(h.options...).Handle(cc) SOCKS5Handler(h.options...).Handle(cc)
default: // http default: // http