'use strict'const fastify =fastifyfastifyfastify
node server.js and navigate to
const host = locationoriginconst ws = hostws console
Then, still in the browser console, send some messages to the server and watch as they're echoed back to you:
ws// => undefined// LOG: WebSockets are awesome!
The creator of
uws has ceased development on
uws and started working on their new project, uWebSockets.js. If you want high-performance web socket support in Fastify, the last real release of
uws (10.148.1) is probably your best bet, but given that it is now an abandoned project I can't recommend anyone use it for any non-throwaway projects. If you're using this library, I'd recommend you stick with the default
In addition, if you choose to use
uws as your WebSocket library, ensure that you have configured your system properly and understand that the API is a slightly reduced subset of
Licensed under MIT.