Static IP guide

Making API requests with a static IP from a Node app on Koyeb

Koyeb services get dynamic egress addresses, so an API partner that allowlists by IP needs Fixie in front of your outbound traffic. Create the proxy, store it with koyeb secret create FIXIE_URL, reference it in the service environment, and axios sends every call from a fixed pair of addresses.

RuntimeNode.js and JavaScript
PlatformKoyeb
DestinationAPI allowlisting
Fixie productFixie HTTP/S proxy

Recommended setup

Use Fixie HTTP/S proxy for HTTP and HTTPS requests to an API, webhook provider, or service that allowlists outbound IP addresses. Store the proxy value in FIXIE_URL, then configure Node.js to route outbound traffic through Fixie before connecting to API allowlisting.

Set up Fixie on Koyeb

Create a Fixie HTTP/S proxy in the Fixie dashboard. Copy the proxy value into Koyeb secrets as FIXIE_URL, and copy the outbound IPs into the destination allowlist.

Set a Koyeb secret

koyeb secret create FIXIE_URL --value "..."
koyeb app init YOUR_APP_NAME --env "FIXIE_URL=@FIXIE_URL"

Implementation

The example below shows the core application-side change. Keep credentials in environment variables and avoid committing proxy, database, or API secrets.

Make an HTTP request through FIXIE_URL

const axios = require('axios');

const fixieUrl = new URL(process.env.FIXIE_URL);

axios.get('https://api.example.com/data', {
  proxy: {
    protocol: 'http',
    host: fixieUrl.hostname,
    // URL drops default ports, so fall back to 80 for Fixie's standard proxy port.
    port: Number(fixieUrl.port) || 80,
    auth: {
      username: fixieUrl.username,
      password: fixieUrl.password,
    },
  },
}).then((response) => {
  console.log(response.status);
});

Good to know

  • Koyeb regions map to Fixie regions (fra pairs with EU, for instance); check koyeb instances list and create the proxy nearby.
  • The @SECRET_NAME syntax in --env keeps the credential out of service definitions and logs.

Allowlist and test the static IPs

  1. Open the Fixie dashboard and copy the outbound IP addresses for this proxy.
  2. Add both IPs to the API provider.
  3. Deploy the updated Node.js app on Koyeb.
  4. Run a small connection test before sending production traffic.

Related guides

Related docs