Skip to content

Commit

Permalink
Remove TCPConn.SetKeepAlive as it's on by default
Browse files Browse the repository at this point in the history
  • Loading branch information
riobard committed Aug 12, 2020
1 parent a44e366 commit 24ded0c
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions tcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ func tcpLocal(addr, server string, shadow func(net.Conn) net.Conn, getAddr func(

go func() {
defer c.Close()
c.(*net.TCPConn).SetKeepAlive(true)
tgt, err := getAddr(c)
if err != nil {

Expand Down Expand Up @@ -71,7 +70,6 @@ func tcpLocal(addr, server string, shadow func(net.Conn) net.Conn, getAddr func(
}
defer rc.Close()
tc := rc.(*net.TCPConn)
tc.SetKeepAlive(true)
if config.TCPCork {
timedCork(tc, 10*time.Millisecond)
}
Expand Down Expand Up @@ -112,7 +110,6 @@ func tcpRemote(addr string, shadow func(net.Conn) net.Conn) {

go func() {
defer c.Close()
c.(*net.TCPConn).SetKeepAlive(true)
c = shadow(c)

tgt, err := socks.ReadAddr(c)
Expand All @@ -127,7 +124,6 @@ func tcpRemote(addr string, shadow func(net.Conn) net.Conn) {
return
}
defer rc.Close()
rc.(*net.TCPConn).SetKeepAlive(true)

logf("proxy %s <-> %s", c.RemoteAddr(), tgt)
_, _, err = relay(c, rc)
Expand Down

0 comments on commit 24ded0c

Please sign in to comment.