Skip to content

Instantly share code, notes, and snippets.

@geNAZt
Created January 24, 2013 19:23
Show Gist options
  • Save geNAZt/4626717 to your computer and use it in GitHub Desktop.
Save geNAZt/4626717 to your computer and use it in GitHub Desktop.
var MuxDemux = require('mux-demux');
var net = require('net');
var es = require('event-stream');
var ms = require('msgpack-stream');
net.createServer(function (con) {
var mdm = MuxDemux();
con.pipe(mdm).pipe(con);
mdm.on('connection', function (stream) {
console.log("Connection: ", stream);
stream.on('data', function (data) {
console.log(data);
});
})
}).listen(8642);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment