cmd/derper: add missing read/write timeouts

Updates tailscale/corp#2486

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
pull/2760/head
Brad Fitzpatrick 3 years ago committed by Brad Fitzpatrick
parent 9b7fc2ed1f
commit 00b3c1c042

@ -187,6 +187,16 @@ func main() {
httpsrv := &http.Server{
Addr: *addr,
Handler: mux,
// Set read/write timeout. For derper, this basically
// only affects TLS setup, as read/write deadlines are
// cleared on Hijack, which the DERP server does. But
// without this, we slowly accumulate stuck TLS
// handshake goroutines forever. This also affects
// /debug/ traffic, but 30 seconds is plenty for
// Prometheus/etc scraping.
ReadTimeout: 30 * time.Second,
WriteTimeout: 30 * time.Second,
}
var err error

Loading…
Cancel
Save