Created
January 24, 2016 17:54
-
-
Save jcarroyo/5886044cdd64245aa53f to your computer and use it in GitHub Desktop.
Very simple echo server in Node.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var net = require('net'); | |
var server = net.createServer(function(socket){ | |
socket.on('data', function(data){ | |
console.log('data received', data.toString()); | |
socket.write(data, function(){ | |
console.log("data re-sended"); | |
}) | |
}); | |
}).listen(9090); | |
server.on('listening', function(){ | |
console.log('server is listening'); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment