Expected Behavior / New Feature
Each route should support an optional WebSocketBufferSize configuration property
that overrides the default receive/send buffer size used in WebSocketsProxyMiddleware.
Actual Behavior / Motivation for New Feature
The buffer size in WebSocketsProxyMiddleware is hardcoded to 4096 bytes.
This causes choppy/degraded video streams over WebSocket connections when hosting
with HTTP.sys. HTTP.sys is more sensitive to small receive buffers than Kestrel
due to differences in kernel-level I/O handling — 4096 bytes is insufficient
for high-bandwidth routes such as video streaming.
Steps to Reproduce the Problem
- Host Ocelot with HTTP.sys (not Kestrel)
- Configure a WebSocket route proxying a video stream
- Observe choppy/degraded stream quality caused by the 4096-byte buffer limit
Specifications
- Version: 25.0
- Platform: .NET 10, Windows (HTTP.sys)
- Subsystem: WebSockets
Expected Behavior / New Feature
Each route should support an optional
WebSocketBufferSizeconfiguration propertythat overrides the default receive/send buffer size used in
WebSocketsProxyMiddleware.Actual Behavior / Motivation for New Feature
The buffer size in
WebSocketsProxyMiddlewareis hardcoded to 4096 bytes.This causes choppy/degraded video streams over WebSocket connections when hosting
with HTTP.sys. HTTP.sys is more sensitive to small receive buffers than Kestrel
due to differences in kernel-level I/O handling — 4096 bytes is insufficient
for high-bandwidth routes such as video streaming.
Steps to Reproduce the Problem
Specifications