Websocket provider for AdonisJS v6, version 0.2.3, actively maintained. Provides WebSocket route registration via router.ws(), middleware support, broadcasting, and controller-based handling. Integrates seamlessly with AdonisJS core, auth, and HTTP server. Alternative to socket.io with tighter AdonisJS integration.
npm install adonisjs-websocketNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Install the package, define a WebSocket route, and handle messages.
Upgrade Node.js to v20.6.0 or later.
Ensure AdonisJS v6.2+ and http-server v7.0.2+ are installed.
Use await ws.broadcast() inside async handler.
Use import type { WebSocketContext } from 'adonisjs-websocket'.Define handler as async ({ ws }) => { ... }.Run `node ace add adonisjs-websocket` to install and configure.
Ensure handler is async and await ws.broadcast().
Install @adonisjs/core v6.2+ and @adonisjs/http-server v7.0.2+.