Created
March 15, 2013 21:00
-
-
Save smfreegard/5173073 to your computer and use it in GitHub Desktop.
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'); | |
var server = net.createServer(function (client) { | |
var addr = client.server.address(); | |
client.write(JSON.stringify(addr, null, '\t')); | |
client.end(); | |
}); | |
server.listen(1234, function () { | |
var addr = server.address(); | |
console.log('listening on port: ' + addr.port); | |
}); | |
server.listen(4321, function () { | |
var addr = server.address(); | |
console.log('listening on port: ' + addr.port); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment