Server-side client for rtheunissen/rockets

This is a client for rockets/rockets.

See rockets/demo.

npm install rockets
var Rockets = require('rockets');
var client = new Rockets();
// Register events on the client. 
client.on('connect', function() {
  var include = {
    // Only receive comments in r/programming. 
    subreddit: 'programming',
    // Only receive comments that contain the pattern 'rockets'. 
    contains: [
  var exclude = {
    // Skip comments that contain the word "hack". 
    contains: [
  // Subscribe to the 'comments' channel. 
  client.subscribe('comments', include, exclude);
client.on('comment', function(comment) {
  // Do something using the comment data. 
// Initiate the client's socket connection. 

Events can be registered with client.on('event', handler).

connectConnection to the server has been established
disconnectConnection to the server has been lost
errorerrorError has occurred
modelmodelReceived model, either post or comment
commentmodelReceived a comment
postmodelReceived a post
subscribechannel, [include [, exclude]]Subscribes to a channel, with optional include and exclude rules
availableReturns true if the socket connection is open
closeClose the connection to the server