Static IP guide

Making API requests with a static IP from a Go app on Heroku

Go's standard library makes the Heroku setup minimal: http.ProxyURL wires FIXIE_URL into a Transport, or you can skip code entirely because http.DefaultTransport already honors HTTP_PROXY and HTTPS_PROXY. Either way your dyno's requests exit from two fixed addresses.

RuntimeGo
PlatformHeroku
DestinationAPI allowlisting
Fixie productFixie HTTP/S Heroku add-on

Recommended setup

Use Fixie HTTP/S Heroku add-on 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 Go to route outbound traffic through Fixie before connecting to API allowlisting.

Set up Fixie on Heroku

Heroku is a native Fixie marketplace flow. Install the Fixie HTTP/S Heroku add-on or attach it from the Heroku CLI. Heroku will create FIXIE_URL as a config var for the app.

Attach fixie to your Heroku app

heroku addons:create fixie
heroku config:get 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

package main

import (
  "net/http"
  "net/url"
  "os"
)

func main() {
  fixieURL, err := url.Parse(os.Getenv("FIXIE_URL"))
  if err != nil {
    panic(err)
  }

  client := &http.Client{
    Transport: &http.Transport{Proxy: http.ProxyURL(fixieURL)},
  }

  _, err = client.Get("https://api.example.com/data")
  if err != nil {
    panic(err)
  }
}

Good to know

  • Setting HTTP_PROXY and HTTPS_PROXY config vars to the FIXIE_URL value proxies every default-transport request in the process — useful when third-party SDKs own the HTTP client.
  • Proxy credentials ride in the URL itself; no separate authenticator is needed for Go's transport.

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 Go app on Heroku.
  4. Run a small connection test before sending production traffic.

Related guides

Related docs