code: function proxy(url, opts) {
    opts = opts || {};
  
    var _proxy;
  
    if (!url) {
      _proxy = process.env.http_proxy || process.env.HTTP_PROXY || process.env.https_proxy || process.env.HTTPS_PROXY;
    } else if (!_proxyIgnored(url, opts)) {
      if (!url.match(/^https?:\/\//)) {
        url += 'http://' + url;
      }
  
      if (url.match(/^https:\/\//)) {
        _proxy = process.env.https_proxy || process.env.HTTPS_PROXY || process.env.http_proxy || process.env.HTTP_PROXY;
      } else {
        _proxy = process.env.http_proxy || process.env.HTTP_PROXY;
      }
    }
  
    return _proxy;
  }
docs: Determines proxy value based on URL and process environment variable (http_proxy, https_proxy).
  This allows library clients to control which proxy to use by setting environment variable.
  - if url starts with http, use http_proxy when available
  - if url starts with https, use https_proxy when available, otherwise fallback to http_proxy
  - if url does not have protocol, assume http protocol
  - if url is not specified, http_proxy takes precedence over https_proxy
  
  @param {String} url: URL used to determine which proxy environment variable to use
  @param {Object} opts: optional
  - noProxyHosts: an array of host names which will ignore any proxy settings, defaults to: localhost, 127.0.0.1
  @return proxy