title: NodeJS TCP Socket does not show client hostname information
body: <p>lets say I've created a simple node.js TCP Socket server as follows.</p>
  
  <pre><code>var server = net.createServer(function (socket) {
    socket.end("goodbye\n");
  });
  // listen on port 80, like a webserver would, and configured to accept connections to multiple hosts, ie test.example.com, sdfsdfsdf.example.com, example2.com. 
  server.listen(80, function() {
    address = server.address();
    console.log("opened server on %j", address);
  });
  
  server.on('connection', function(socket) {
      //log('connection data', socket);
      log('CONNECTED SOCKET DATA', socket.address());
      log('CONNECTED LOCAL, %s:%s', socket.localAddress, socket.localPort);
      log('CONNECTED %s:%s', socket.remoteAddress, socket.remotePort);
  
      //How do I find the server hostname that the client connected to?
      // eg test.example.com or example2.com
  });
  </code></pre>
  
  <p>Once a tcp <code>connection</code> is made, I want to parse the hostname that the client attempted to connect to. However the <code>socket</code> does not seem to have this information.</p>
  
  <p>The following is what I got when I ran the previous code (removed ip addresses)</p>
  
  <pre><code>CONNECTED SOCKET DATA { port: 80, family: 2, address: '[SERVER IP ADDRESS]' }
  CONNECTED LOCAL, undefined:undefined
  CONNECTED [CLIENT IP ADDRESS]:13263
  </code></pre>
  
  <p>I've gone through the nodejs <a href="http://nodejs.org/docs/latest/api/all.html#all_class_net_socket" rel="nofollow">socket documentation</a> but I cant find anything related to host name. The documentation actually says that the <code>socket.localAddress</code> will be an IP Address, with makes it useless in my case. </p>