From c033587f196b40f6497440b0f5e3f60ca9b59715 Mon Sep 17 00:00:00 2001 From: mohuishou <1@lailin.xyz> Date: Sun, 26 Nov 2017 15:41:27 +0800 Subject: [PATCH] fixed #78 --- socks/socks.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/socks/socks.go b/socks/socks.go index c3f42e88..047ea867 100644 --- a/socks/socks.go +++ b/socks/socks.go @@ -188,11 +188,12 @@ func Handshake(rw io.ReadWriter) (Addr, error) { if _, err := io.ReadFull(rw, buf[:3]); err != nil { return nil, err } + buf1 := buf[1] addr, err := readAddr(rw, buf) if err != nil { return nil, err } - switch buf[1] { + switch buf1 { case CmdConnect: _, err = rw.Write([]byte{5, 0, 0, 1, 0, 0, 0, 0, 0, 0}) // SOCKS v5, reply succeeded case CmdUDPAssociate: