GioJSdocs
Get StartedReleasesGitHub ↗
Building Your App

WebSockets

Full-duplex connections over a dedicated IPC pipe.

Export a wsHandler from a route.ts to accept WebSocket connections at that path. WebSocket and HTTP IPC are independent, so neither blocks the other.

ts
export function wsHandler(socket) {
  socket.on('message', (msg) => socket.send('echo: ' + msg));
}

Connection registry

The registry exposes send, broadcast, close, and on() hooks for managing many connections.