Skip to main content
Camofox can route all browser traffic through a proxy server and automatically configure the browser fingerprint to match the proxy’s geographic location. This ensures consistent geolocation signals across all browser APIs.

Environment variables

Set these environment variables before starting the Camofox server:

Configuration

Local development

Docker deployment

Fly.io deployment

Railway deployment

In the Railway dashboard:
  1. Go to your service → Variables
  2. Add:
    • PROXY_HOST = 166.88.179.132
    • PROXY_PORT = 46040
    • PROXY_USERNAME = myuser
    • PROXY_PASSWORD = mypass
  3. Redeploy

How GeoIP works

When proxy configuration is detected, Camofox’s GeoIP feature automatically:
  1. Resolves the proxy’s exit IP address via geo-lookup
  2. Sets browser locale to match the IP’s country (e.g., en-GB for UK, de-DE for Germany)
  3. Sets timezone to match the IP’s region (e.g., Europe/London, America/New_York)
  4. Sets geolocation coordinates to match the IP’s city (latitude/longitude)
  5. Configures Camoufox fingerprint to align with the derived locale
This happens at browser launch time. All tabs created in the browser session inherit these settings.

Without proxy

If no proxy is configured, Camofox uses default US-based fingerprinting:
  • Locale: en-US
  • Timezone: America/Los_Angeles
  • Geolocation: San Francisco, CA coordinates (37.7749, -122.4194)

Fingerprint consistency

GeoIP ensures that all geolocation signals exposed to websites are consistent: This prevents geolocation mismatches that can trigger bot detection. For example, if your proxy exits in Germany but your browser claims to be in California, sites may flag the session as suspicious.
Do not override locale/timezone in the Playwright context when using GeoIP. Let Camoufox manage these settings automatically.

Proxy protocol

Camofox uses HTTP CONNECT tunneling (server.js:286-298):
All traffic (HTTP, HTTPS, WebSocket) is routed through the proxy. The server supports:
  • HTTP proxies with CONNECT tunneling
  • SOCKS5 proxies (if your proxy supports it)
  • Basic authentication via username/password

Implementation details

Proxy config resolution

The buildProxyConfig() function (server.js:285-299) checks for proxy environment variables at startup:
If PROXY_HOST or PROXY_PORT is missing, proxy is disabled.

Browser launch with GeoIP

When launching the browser (server.js:379-396), the proxy config is passed to Camoufox’s launchOptions():
The geoip: !!proxy flag tells Camoufox to perform geo-lookup and configure fingerprinting.

Context creation without overrides

When creating browser contexts for sessions (server.js:432-443), the code checks if a proxy is configured:
If proxy is configured, locale/timezone/geolocation are not set in the context options, allowing Camoufox’s GeoIP to apply them automatically.

Residential proxies

For best results, use residential proxies instead of datacenter proxies. Residential IPs are less likely to be flagged by anti-bot systems. Recommended providers:
Rotating residential proxies are ideal for scraping multiple pages without getting rate-limited. Sticky session proxies are better for maintaining login state across requests.

Proxy rotation

Camofox does not rotate proxies automatically. Each browser instance uses a single proxy configuration for its entire lifetime. For proxy rotation:
  1. Restart the browser with a new proxy config (not recommended - slow)
  2. Deploy multiple Camofox instances with different proxy configs behind a load balancer
  3. Use rotating proxies from your provider (proxy endpoint rotates IPs per request)
Option 3 is recommended. Most residential proxy providers support session-based rotation where each new TCP connection gets a new IP.

Debugging proxy issues

Connection failures

Symptoms: Browser fails to launch, all page loads timeout Causes:
  • Proxy host/port unreachable
  • Firewall blocking outbound connections
  • Proxy authentication failed
Fix: Test the proxy with curl:
This should return the proxy’s exit IP. If it fails, the proxy config is incorrect.

GeoIP mismatch

Symptoms: Browser locale/timezone don’t match proxy location Causes:
  • GeoIP database out of date
  • Proxy IP is newly allocated and not in geo databases
  • Context options override GeoIP settings
Fix: Ensure you’re not setting locale, timezoneId, or geolocation in the context options when using GeoIP.

Slow page loads

Causes:
  • High latency proxy
  • Proxy bandwidth throttling
Fix: Use a faster proxy or increase NAVIGATE_TIMEOUT_MS (default 30s).

Logging

Camofox logs proxy status at startup:
If geoip: true, GeoIP is active.