Fixed: close connection when read target error
This commit is contained in:
parent
1a8f363ea6
commit
b5f24c56b2
1 changed files with 2 additions and 1 deletions
|
@ -36,7 +36,8 @@ func NewSocksProxy(port string) {
|
||||||
func handleSocks(conn net.Conn) {
|
func handleSocks(conn net.Conn) {
|
||||||
target, err := socks.Handshake(conn)
|
target, err := socks.Handshake(conn)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
conn.Close()
|
||||||
|
return
|
||||||
}
|
}
|
||||||
conn.(*net.TCPConn).SetKeepAlive(true)
|
conn.(*net.TCPConn).SetKeepAlive(true)
|
||||||
tun.Add(NewSocks(target, conn))
|
tun.Add(NewSocks(target, conn))
|
||||||
|
|
Loading…
Reference in a new issue