Randy
Rodeo.
Socket.io based realtime notifications withInstallation
npm install node-randy
Server Setup
Randy setup is rather simple. To get a notifications server up and running simply:
var randy = ;randy;
Optionally, you can pass in Redis connection settings (see Matt Ranney's Redis module for details):
var randy = ;randy;
Client Setup
The client side is vanilla socket.io and only requires handling of three actions: register
, notice
, and dismiss
(and read
optionally). For example:
var socket = io;var user = 'test::user1234'; // Emit the "register" event with a unique user id and type (optional).socket; // If a notice is received, display it!socket;
Methods
listen
Socket.io Actions (Incoming)
notice
Socket.io Actions (Outgoing)
register
read
dismiss
To Test
npm test