title: How do I configure my server to use a fixie static IP?
body: <p>I have sent a GET request using clash of clans API and axios and provided the authentication for it to work locally however it doesn't work when deployed as heroku uses dynamic Ip addresses.</p>
  <p>I am looking to use static Ip addresses which Heroku will use to authorize my api request. I have chosen fixie however I dont think my server is actually using the static IP as when navigate to the endpoint, the page fails and the network tab shows a remote connection from what seems to be a heroku IP address. Essentially I need to whitelist an Ip.</p>
  <p>Here is my code:</p>
  <pre><code>require(&quot;dotenv&quot;).config();
  const express = require(&quot;express&quot;);
  const axios = require(&quot;axios&quot;);
  const app = express();
  const path = require('path');
  const url = require('url');
  const fixieUrl = url.parse(process.env.FIXIE_URL);
  const requestUrl = url.parse('https://api.clashofclans.com/v1/players/%232889v22uq');
  // const URL = &quot;https://api.clashofclans.com/v1/players/%232889v22uq&quot;;
  
  const options = {
    headers: {
      Host: requestUrl.host,
      'Proxy-Authorization': `Basic ${Buffer.from(fixieUrl.auth).toString('base64')}`,
      &quot;Authorization&quot;: `Bearer ${process.env.API_TOKEN}`
    },
    host: fixieUrl.hostname,
    port: fixieUrl.port,
    path: requestUrl.href,
  };
  
  app.get(&quot;/api&quot;, (req, res) =&gt; {
  
    const clashReq = async () =&gt; {
      try {
        const response = await axios.get(requestUrl, options);
  
        const {
          name,
          townHallLevel,
          trophies,
          bestTrophies,
          builderHallLevel,
          league: {
            name: leagueName,
            iconUrls: { medium: mediumIcon },
          },
          legendStatistics: {
            previousSeason: { trophies: previousTrophies},
            bestSeason: { trophies: bestSeasonTrophies},
            currentSeason: { trophies: currentTrophies},
          },
        } = response.data;
        
        res.json({
            name,
            townHallLevel,
            trophies,
            bestTrophies,
            builderHallLevel,
            leagueName,
            mediumIcon,
            previousTrophies,
            bestSeasonTrophies,
            currentTrophies
          }
        );
      } catch (error) {
        console.log(error);
      }
    };
  
    clashReq();
   
  
    console.log(res.statusCode);
    
  });
  
  
  
  if (process.env.NODE_ENV === &quot;production&quot;) {
    app.use(express.static(path.join(__dirname, &quot;/client/build&quot;)));
    app.get(&quot;*&quot;, (req, res) =&gt; {
      res.sendFile(path.join(__dirname, &quot;/client/build&quot;, &quot;index.html&quot;));
    });
  }
  
  app.listen(process.env.PORT || 3001, () =&gt; {
    console.log(`Server running`);
  });
  
  </code></pre>