Skip to content

Add configurable WebSocket buffer size per route #2386

Description

@erannevo

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

  1. Host Ocelot with HTTP.sys (not Kestrel)
  2. Configure a WebSocket route proxying a video stream
  3. Observe choppy/degraded stream quality caused by the 4096-byte buffer limit

Specifications

  • Version: 25.0
  • Platform: .NET 10, Windows (HTTP.sys)
  • Subsystem: WebSockets

Metadata

Metadata

Assignees

Labels

CoreOcelot Core related or system upgrade (not a public feature)Summer'26Summer 2026 releaseWebsocketsOcelot feature: WebsocketsacceptedBug or feature would be accepted as a PR or is being worked onfeatureA new feature

Fields

No fields configured for Feature.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions