-
-
Save cyberhazard/ef2bb27634fb70725b1c18b04f9de180 to your computer and use it in GitHub Desktop.
A very simple TCP echo server, written in Node.js
This file contains hidden or 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