fastify-simple-ws
WebSocket support for Fastify built on the blazing fast ws library (removed uws support).
Example
In server.js
:
'use strict' const fastify = fastify fastify fastify
Then run node server.js
and navigate to http://localhost:34567
in your browser. In the browser's JavaScript console, open a client-side WebSocket connection:
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!
Notes
This forked version removes the support for uws
.
License
Licensed under MIT.