Commit 5cf65777 authored by zhengrui's avatar zhengrui

fix #225

parent 6afb0a8f
...@@ -95,8 +95,18 @@ func (h *autoHandler) Handle(conn net.Conn) { ...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment