fastify-websocket-server
Fastify plugin that creates websocket server on your fastify instance.
ToC
fastify-ws
?
Why not use - It doesn't support all
ws
options in it's constructor. - It doesn't expose types and doesn't support typescript out of the box.
Getting started
Installation
npm i fastify-websocket-server
Usage
const fastify = const websocketPlugin = ; fastify
Docs
Docs available via link.
Roadmap
Any ideas or PR welcome
Support for "typed" websockets
Allow setting message types via query param or some header. This will set default message mode.
Better support for JSON messages
The idea is if websocket message type is set to JSON to add following:
- support JSON message validation against schema, just like Fastify does.
- use
fast-json-stringify
module to serialize messages with schemas