From 617aee325f870344fdedeae7b391db237b2e6b27 Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Fri, 8 Jan 2021 14:05:02 +0100 Subject: [PATCH] Reduce ping timetout to 45 to 55s. Thanks to Jeroen van Veen for the debugging. --- rtpconn/webclient.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rtpconn/webclient.go b/rtpconn/webclient.go index b651f57..3cb5cef 100644 --- a/rtpconn/webclient.go +++ b/rtpconn/webclient.go @@ -902,10 +902,13 @@ func clientLoop(c *webClient, ws *websocket.Conn) error { return errors.New("unexpected action") } case <-ticker.C: - if time.Since(readTime) > 90*time.Second { + if time.Since(readTime) > 75*time.Second { return errors.New("client is dead") } - if time.Since(readTime) > 60*time.Second { + // Some reverse proxies timeout connexions at 60 + // seconds, make sure we generate some activity + // after 55s at most. + if time.Since(readTime) > 45*time.Second { err := c.write(clientMessage{ Type: "ping", })