disabled all http server read timeouts

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>
This commit is contained in:
Dmitri Dolguikh
2026-09-10 14:47:10 +02:00
parent c645a6c72b
commit adf5005ba4
+4 -4
View File
@@ -3,7 +3,6 @@ package server
import (
"net/http"
"sync/atomic"
"time"
"github.com/coder/websocket"
log "github.com/sirupsen/logrus"
@@ -95,14 +94,15 @@ func (ph *proxyHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
// MaxConcurrentStreams: 20,
// IdleTimeout: 10 * time.Second,
}).ServeConn(serverConn, &http2.ServeConnOpts{
Context: ctx,
Handler: ph.handler,
Context: ctx,
Handler: ph.handler,
BaseConfig: &http.Server{
// b/c we are wrapping a ws connection, ReadTimeout is effectively ignored until
// an h2 stream is opened and its read timeout is set. Until that time we are relying
// on ws connection built-in timeouts, which we have no control over.
// Stream timeout effectively sets a deadline for reading of a complete request body.
ReadTimeout: 5 * time.Second,
// ReadTimeout: 5 * time.Second,
// ReadHeaderTimeout: 5 * time.Second,
},
})