title: node-fetch responding with 503 where request responding with 200 behind proxy
body: <p>Below I have two http requests, one made with <code>request</code> and the other being made with <code>isomorphic-fetch</code> (<code>node-fetch</code>). For some reason the request with <code>request</code> works, however <code>node-fetch</code> is responding back with an error code <code>503</code>. Is there anything I am missing from the fetch version? </p>
  
  <pre><code>const URL = require('url')
  const fetch = require('isomorphic-fetch')
  const HttpsProxyAgent = require('https-proxy-agent')
  const request = require('request');
  
  const url = process.env.URL
  const proxy = process.env.PROXY
  
  const requestPromise = function (url, options) {
      if (/^\/\//.test(url)) {
      url = 'https:' + url;
      }
  
      return new Promise(function(resolve, reject) {
          return request.call(this, url, options, function (err, res, body) {
              if (err) {
              throw new Error(err);
              }
  
              res.ok = true;
              res.json = function () {
              return JSON.parse(res.body);
              }
              return resolve(res);
          });
      });
  };
  
  function getProxy (url) {
      const parsedProxyURL = URL.parse(url);
      parsedProxyURL.secureProxy = parsedProxyURL.protocol === 'https:';
      return parsedProxyURL
  }
  
  requestPromise(url, {
      agent:new HttpsProxyAgent(getProxy(proxy))
  })
      .then(console.log)
      .catch(console.log)
  
  
  fetch(url, {
      agent:new HttpsProxyAgent(getProxy(proxy))
  })
      .then(console.log)
      .catch(console.log)
  </code></pre>