Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Reliable message service for websocket-based clients



Copyright 2011 by Liam Breck, Menlo Park, California

A reliable message queue service for socket-connected clients.
The initial goal is to enable messaging among Node.js instances on the public net.
Clients' connections are assumed to be potentially unreliable.

As with email, each message is posted with a list of recipients.
A user may have multiple aliases; a single user may be sent a short message via an alias.
A user may have multiple client "nodes"; messages are queued for all nodes.
Distribution lists are supported.
On disk, messages are stored in separate files, within transient directories for each recipient.

  mqlib.js - message queue module.
  mqserver.js - example app with websocket server. Creates an mqstore/ directory in the working directory.
  mqclient.js - client module connecting via websocket client.
  mqtest.js - test client. Creates 10 clients which connect/send/disconnect.
  wsstream - websocket stream module

  Node.js 0.2.x

  $ node mqserver.js &    # run server in background
  $ node mqtest.js        # run test client; stop with ctl-C
  $ node mqserver.js stop # stop server

Message format
  messages are delimited with websocket-style frames
  f0f {"op":"type" ...}data
  1-4 hex digits, padded with 0-3 spaces, giving the size of the JSON metadata object
  JSON metadata
  arbitrary size 8-bit data

Message op types
  To server: register, login, listEdit, post, ping, ack
  To client: registered, info, quit, deliver, ack

  Implement user registration with email confirmation
  Redis(?) user database
  Manage inactive nodes/users
  Email gateway with SMTP client and LMTP server

Something went wrong with that request. Please try again.