Skip to Content
HeronJS v4 is now available.
4.0.0WebSocketOverview

WebSocket Overview

@heronjs/websocket@4.0.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, @ReceiveFrom selects incoming events, and @SendTo declares the reply event. 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