Skip to content

Commit

Permalink
Fixed: close connection when read target error
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamacro committed Jun 12, 2018
1 parent 4f769de commit 795557a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion proxy/socks.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 795557a

Please sign in to comment.