Skip to content

Instantly share code, notes, and snippets.

@SamDecrock
Last active December 11, 2018 11:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SamDecrock/941fe7cd592bb97bc7593c8df23f4c13 to your computer and use it in GitHub Desktop.
Save SamDecrock/941fe7cd592bb97bc7593c8df23f4c13 to your computer and use it in GitHub Desktop.
// this one liner starts a TCP server on port 3000 and spits out all the data it receives
// just run `node` from the command line and past the following:
require('net').createServer(function(socket) { socket.on('data', function(data) { console.log(data.toString()) }); }).listen(3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment