reverseproxy: make stream copy buffer size configurable (#7627)

This commit is contained in:
Zen Dodd
2026-04-11 06:49:32 +10:00
committed by GitHub
parent 92b62004eb
commit ca0ca67fbd
5 changed files with 129 additions and 4 deletions
@@ -171,6 +171,12 @@ type Handler struct {
// forcibly closed at the end of the timeout. Default: no timeout.
StreamTimeout caddy.Duration `json:"stream_timeout,omitempty"`
// The size of the buffer used for each direction of streaming
// requests such as WebSockets. If zero, the default size is 32 KiB.
// This only affects upgraded bidirectional streams, not normal
// request or response buffering.
StreamBufferSize int `json:"stream_buffer_size,omitempty"`
// If nonzero, streaming requests such as WebSockets will not be
// closed when the proxy config is unloaded, and instead the stream
// will remain open until the delay is complete. In other words,