Skip to Content
HeronJS v4 is now available.
Versionv4WebSocketOverview

WebSocket Overview

@heronjs/websocket@4.7.0 implements native WebSocket handlers on the shared HTTP listener. Browser WebSocket clients are supported. Socket.IO clients use a different protocol.

Register handlers in @Module({websockets: [...]}). @WebSocket declares a namespace, @OnMessage receives an event and replies on the same connection. Use @ReceiveFrom and @SendTo separately when needed. Handlers execute sequentially per connection and use the first result from values, Promises or Observables.

Connection lifecycle hooks, authentication, guards, bounded buffering and shutdown are owned by the extension. Configure allowed origins, authentication and limits explicitly for the application.

Follow the Quick Start for server/client examples and configuration defaults.

Last updated on