title: How to use axios with a proxy server to make an https call?
body: <p>It's basically the <a href="https://stackoverflow.com/questions/43240483/axios-https-request-over-proxy">same question here</a>.</p>
  
  <p>I'm using a browser. The following code is compiled by webpack.
  I tried this:</p>
  
  <pre class="lang-js prettyprint-override"><code>const axios = require('axios');
  
  var res = await axios.get('https://api.ipify.org?format=json', {
      proxy: {
          host: 'proxy-url',
          port: 80,
          auth: {username: 'my-user', password: 'my-password'}
      }
  });
  console.log(res.data); // gives my ip and not the proxy's one.
  </code></pre>
  
  <p>I also tried this with the same code, but it did not work:</p>
  
  <pre class="lang-js prettyprint-override"><code>const axios = require('axios-https-proxy-fix');
  </code></pre>
  
  <p>Then, I tried with httpsAgent:</p>
  
  <pre class="lang-js prettyprint-override"><code>const axios = require('axios');
  const HttpsProxyAgent = require('https-proxy-agent')
  
  var agent = new HttpsProxyAgent('http://my-user:my-pass@proxy-url:port');
  var res = await axios.get('https://api.ipify.org?format=json', {
      httpsAgent: agent,
  });
  console.log(res.data); // gives my ip and not the proxy's one.
  </code></pre>
  
  <p>Is this a bug? Am I cursed or maybe do I have a problem reading the documentation?</p>