Basic WebSocket support for Fastify built on the ws and uws libraries. Current stable version is 1.0.3, with infrequent releases. It provides a simple plugin to add WebSocket functionality to Fastify, exposing a `fastify.ws` WebSocket.Server instance. Supports both `ws` (default) and `uws` backends, but `uws` is abandoned. Differentiator: minimal plugin for legacy Fastify versions, but not actively maintained and lacks full lifecycle management compared to @fastify/websocket.
npm install fastify-wsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Registers fastify-ws plugin, waits for ready, then adds an echo WebSocket server.
Use @fastify/websocket which is the official Fastify WebSocket plugin.
Do not configure uws; stick with default ws backend.
Call fastify.ready() or await fastify.ready() before using fastify.ws.
Ensure fastify.register(require('fastify-ws')) is called and then await fastify.ready() before accessing fastify.ws.Use import fastifyWs from 'fastify-ws' inside a "type": "module" package or use require().