code: function hostnameof (req) {
    var host = req.headers.host
  
    if (!host) {
      return
    }
  
    var offset = host[0] === '['
      ? host.indexOf(']') + 1
      : 0
    var index = host.indexOf(':', offset)
  
    return index !== -1
      ? host.substring(0, index)
      : host
  }
docs: Get hostname of request.
  
  @param (object} req
  @return {string}
  @private