Skip to content

Instantly share code, notes, and snippets.

@skovsgaard
Created December 12, 2014 10:43
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 skovsgaard/191e895129588b5af423 to your computer and use it in GitHub Desktop.
Save skovsgaard/191e895129588b5af423 to your computer and use it in GitHub Desktop.
simple-server
var net = require('net');
net.createServer(function(c) {
c.on('end', function() {
console.log('server disconnected');
});
c.write('OK - 2222 - From YOURNAME\r\n');
c.on('data', function(data) {
c.end();
});
}).listen(2222, function() {
console.log('server bound to 2222');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment