Skip to content

Instantly share code, notes, and snippets.

@iainjreid
Last active September 30, 2019 07:37
Show Gist options
  • Save iainjreid/b42a94c08455a0a251ae5574f37a6df3 to your computer and use it in GitHub Desktop.
Save iainjreid/b42a94c08455a0a251ae5574f37a6df3 to your computer and use it in GitHub Desktop.
A very simple TCP echo server, written in Node.js
const net = require('net')
net.createServer(socket => {
socket.on('data', function(data){
console.log('Echoing: %s', data.toString())
socket.write(data.toString())
})
}).listen(8001)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment