Fixed: close connection when read target error
This commit is contained in:
parent
4f769debe7
commit
795557a2df
1 changed files with 2 additions and 1 deletions
|
@ -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))
|
||||
|
|
Loading…
Reference in a new issue