Fixed: close connection when read target error

This commit is contained in:
gVisor bot 2018-06-12 09:18:15 +08:00
parent 1a8f363ea6
commit b5f24c56b2

View file

@ -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))