Skip to content

Instantly share code, notes, and snippets.

@pedrofaria
Created October 20, 2010 14:24
Show Gist options
  • Save pedrofaria/636516 to your computer and use it in GitHub Desktop.
Save pedrofaria/636516 to your computer and use it in GitHub Desktop.
var net = require('net');
var icardsO = require('./icards');
var icards = new icardsO.iCards();
net.createServer(function (socket) {
socket.setEncoding("utf8");
socket.on('connect', function() {
socket.write("Echo server - "+ socket.fd +"\r\n");
});
socket.on("data", function (data) {
icards.parse(socket, data);
});
socket.on("end", function () {
socket.end();
});
}).listen(8124, "127.0.0.1");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment