-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Description
Hi,
In my Kratos HTTP server, I configure the timeout like this:
if c.Http.Timeout != nil { opts = append(opts, http.Timeout(c.Http.Timeout.AsDuration())) }
As far as I can tell, this timeout is applied at the whole server level and affects all routes.
However, I don’t want this timeout to apply to SSE (Server-Sent Events) and WebSocket connections, since those are long-lived streams by design. I’ve tried several approaches to exclude those endpoints from the timeout, but haven’t been able to make it work.
Is there a recommended way to:
disable http.Timeout for specific routes, or
skip SSE/WebSocket requests when applying the timeout, or
otherwise configure different timeout behavior for streaming connections?
If this is not currently supported, would you consider adding a way to exclude certain routes or connection types (SSE / WebSocket) from the global http.Timeout?