code: function formatURL(httpOptions) {
    var url;
    if (httpOptions.protocol) {
      url = httpOptions.protocol;
    } else {
      url = 'http:';
    }
    url += '//';
    if (httpOptions.auth) {
      url += httpOptions.auth + '@';
    }
    if (httpOptions.host) {
      url += httpOptions.host;
    } else if (httpOptions.hostname) {
      url += httpOptions.hostname;
    } else {
      url += 'localhost';
    }
    if (httpOptions.port && !url.includes(':' + httpOptions.port)) {
      url += ':' + httpOptions.port;
    }
    if (httpOptions.path) {
      url += httpOptions.path;
    } else {
      url += '/';
    }
    return url;
  }
docs: Get a URL as a string from the options object passed to http.get or http.request See https://nodejs.org/api/http.html#http_http_request_options_callback