From 795557a2df516beb46c555d7d4238f8b7917d3d3 Mon Sep 17 00:00:00 2001 From: Dreamacro <305009791@qq.com> Date: Tue, 12 Jun 2018 09:18:15 +0800 Subject: [PATCH] Fixed: close connection when read target error --- proxy/socks.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/proxy/socks.go b/proxy/socks.go index c27f75267..1b5d3db85 100644 --- a/proxy/socks.go +++ b/proxy/socks.go @@ -36,7 +36,8 @@ func NewSocksProxy(port string) { func handleSocks(conn net.Conn) { target, err := socks.Handshake(conn) if err != nil { - + conn.Close() + return } conn.(*net.TCPConn).SetKeepAlive(true) tun.Add(NewSocks(target, conn))