So, I may be missing something simple here, but I can\'t seem to find a way to get the hostname that a request object I\'m sending a response to was requested from.
If you need a fully qualified domain name and have no HTTP request, on Linux, you could use:
var child_process = require("child_process"); child_process.exec("hostname -f", function(err, stdout, stderr) { var hostname = stdout.trim(); });