server.js
var net = require('net');
var server = net.createServer(function (socket) {
socket.on('data',function(s){
console.log(s.toString())
})
});
server.listen(1337, "127.0.0.1");
*****************************************************************************************************************
client.js
var client = require('net').createConnection(1337, '127.0.0.1');
client.on('data', function(s){
console.log(s.toString())
});
client.on('connect', function(s){
client.write('qqqqqqqqqqqqqqqqqqqqqqq')
});