code: function urlFromHttpRequestOptions(options, protocol) {
    var parsedPath = options.path.split('?');
    var pathname = parsedPath.shift();
    var search = parsedPath.join('?');
  
    var urlOptions = {
      protocol: protocol,
      hostname: options.hostname || options.host,
      auth: options.auth,
      port: options.port,
      pathname: pathname,
      search: search
    };
  
    return url.format(urlOptions);
  }
docs: -- CONVENIENCE FUNCTIONS ----------------------------------------------------