summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJames Tucker <james@tailscale.com>2025-01-21 13:17:21 -0800
committerJames Tucker <james@tailscale.com>2025-01-21 13:19:58 -0800
commit900b64403d097ac7260fa18cff1ec718ec2b39c7 (patch)
treeb96a5ba62719805a1045564b8928a4224949284f
parent51adaec35a3e4d25df88d81e6264584e151bd33d (diff)
downloadtailscale-raggi/natc-upstream-keepalive.tar.xz
tailscale-raggi/natc-upstream-keepalive.zip
cmd/natc: send TCP keepalives to upstreamsraggi/natc-upstream-keepalive
Idle connections may silently close, detect those closures with TCP keeliave. Updates tailscale/corp#25169 Signed-off-by: James Tucker <james@tailscale.com>
-rw-r--r--cmd/natc/natc.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/cmd/natc/natc.go b/cmd/natc/natc.go
index d94523c6e..5df060f76 100644
--- a/cmd/natc/natc.go
+++ b/cmd/natc/natc.go
@@ -475,7 +475,8 @@ func proxyTCPConn(c net.Conn, dest string) {
},
}
p.AddRoute(addrPortStr, &tcpproxy.DialProxy{
- Addr: fmt.Sprintf("%s:%s", dest, port),
+ Addr: fmt.Sprintf("%s:%s", dest, port),
+ KeepAlivePeriod: time.Second,
})
p.Start()
}