Created
December 12, 2014 10:43
-
-
Save skovsgaard/191e895129588b5af423 to your computer and use it in GitHub Desktop.
simple-server
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
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