Last active
September 30, 2019 07:37
-
-
Save iainjreid/b42a94c08455a0a251ae5574f37a6df3 to your computer and use it in GitHub Desktop.
A very simple TCP echo server, written 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
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