Skip to content

Extensions

Sören Jensen edited this page Jun 25, 2025 · 1 revision

WebSocket allow extending using middlewares.

Bundled middlewares

These general use middlewares are available in this library.

Standard middlewares

  • CloseHandler - Automatically acts on incoming and outgoing Close requests, as specified in WebSocket protocol
  • PingResponder - Responds with Pong message when receiving a Ping message, as specified in WebSocket protocol

Optional middlewares

  • Callback - Apply provided callback function on specified actions
  • CompressionExtension - Support message compression (Per-Message Deflate)
  • FollowRedirect - Follow redirect during handshake (Client only)
  • PingInterval - Used to automatically send Ping messages at specified interval
  • SubprotocolNegotiation - Helper middleware that negotiate subprotocol

External middlewares

Clone this wiki locally