Static IP guide

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

Fixie began as a Heroku add-on, and the Ruby setup is still the shortest one there is: attach the add-on and set RestClient.proxy (or the equivalent in Faraday or HTTParty) to ENV["FIXIE_URL"]. Every outbound request then leaves from your two static IPs, whatever dyno it runs on.

RuntimeRuby
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 Ruby 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

require "rest-client"

RestClient.proxy = ENV["FIXIE_URL"]
response = RestClient.get("https://api.example.com/data")

puts response.code

Good to know

  • RestClient.proxy is global to the process — set it once in an initializer and every RestClient call is proxied; use Faraday per-connection options if only some requests should go through Fixie.
  • Rails apps calling allowlisted endpoints need both dashboard IPs registered with the partner, not just one.
  • HTTPS is tunneled with CONNECT, so certificate verification behaves exactly as it does without a proxy.

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

Related guides

Related docs