From b272505ab6b49b6dc550234c616b724648093e79 Mon Sep 17 00:00:00 2001 From: Salah Eddine Oukil Date: Mon, 7 Jul 2025 20:36:18 +0100 Subject: [PATCH] Set lower tcp keepalive duration Signed-off-by: salahdevp --- cmd/client/main.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cmd/client/main.go b/cmd/client/main.go index efe6de2..63b3a26 100644 --- a/cmd/client/main.go +++ b/cmd/client/main.go @@ -279,8 +279,13 @@ func main() { transport := &http.Transport{ Proxy: http.ProxyFromEnvironment, DialContext: (&net.Dialer{ - Timeout: 30 * time.Second, - KeepAlive: 30 * time.Second, + Timeout: 30 * time.Second, + KeepAliveConfig: net.KeepAliveConfig{ + Enable: true, + Idle: 30 * time.Second, + Interval: 5 * time.Second, + Count: 3, + }, DualStack: true, }).DialContext, MaxIdleConns: 100,