a simple wrap for ws to make it acts more like Socket.IO

A simple wrap to node.js ws module and then we can use it in a manner like It's really easy to use but it doesn't support Blob yet. So I write a simple wrap to ws module for this purpose. This is also a part of works from a contest by

  1. trnasfer Blob/ArrayBuffer by put it in an object and emit it just as
  2. broadcast to all but not me
  3. emit to specified peer by to(
  4. join/leave/in room
  5. in-memory store
  1. can only send one Blob/ArrayBuffer within one emit
  2. the Blob/ArrayBuffer object must be a property of the emitting object in the first level, no deeper
  3. no configuration support
  4. no 3rd party data store support
  5. cannot scale
  6. client support is now through a static url: /


a simple echo server

var app = require('http').createServer(handler),
io = require('./').listen(app);

function handler (req, res) { res.setHeader('Content-Type', 'text/html'); res.writeHead(200); res.end(""+ ""+ ""+ ""+ ""+ ""+ "echo"+ ""+ ""+ ""); }

io.sockets.on('connection', function (socket) { socket.on('echo', function(data) { socket.emit('echo', data); }); });

will add a blob transfering example soon.