Back to Hex Proxies

Proxies for Geo Testing

Last updated: April 2026

By Hex Proxies Engineering Team

Learn how to verify geo-targeted content, pricing, redirects, and localization across multiple countries using proxy infrastructure for automated QA.

beginner15 minutesdeveloper-qa

Prerequisites

  • Python or Node.js
  • Hex Proxies residential plan with country targeting

Steps

1

Identify geo-testing targets

List URLs, expected behaviors, and target countries for your geo-testing matrix.

2

Set up proxy configuration

Configure Hex Proxies residential credentials with country-level targeting for each test region.

3

Build the test framework

Implement a geo-testing function that tests URLs from multiple countries and records results.

4

Add CI integration

Create assertion functions and integrate geo-tests into your CI/CD pipeline for regression detection.

5

Monitor results

Review geo-test results across deployments to catch localization regressions early.

Proxies for Geo Testing

Geo-targeting bugs are invisible from your development machine. A pricing page showing USD to users in Japan, a redirect loop for European visitors, a CDN misconfiguration serving the wrong language — these issues only surface when you can test from the affected locations. Proxy infrastructure lets you simulate requests from any country without leaving your desk.

Common Geo-Testing Scenarios

ScenarioWhat to TestCritical For
Regional pricingCurrency, tax, price displayE-commerce
Content localizationLanguage, imagery, layoutMultinational sites
Geo-redirectsURL routing by countryInternational SEO
CDN behaviorCache headers, edge selectionPerformance
ComplianceCookie consent, data handlingLegal/GDPR
Ad targetingAd content, placementMarketing

Python Geo-Testing Framework

from dataclasses import dataclass
import httpx

@dataclass(frozen=True)
class GeoTestResult:
    country: str
    url: str
    status: int
    final_url: str
    content_language: str
    currency_detected: str
    response_time_ms: float

def build_proxy_url(username: str, password: str, country: str) -> str:
    return f"http://{username}-country-{country.lower()}:{password}@gate.hexproxies.com:8080"

def run_geo_test(
    url: str,
    country: str,
    username: str,
    password: str,
) -> GeoTestResult:
    """Test a URL from a specific country's perspective."""
    import time
    proxy = build_proxy_url(username, password, country)
    start = time.monotonic()
    with httpx.Client(proxy=proxy, follow_redirects=True, timeout=30) as client:
        resp = client.get(url)
        elapsed = (time.monotonic() - start) * 1000
        content = resp.text.lower()

        # Detect currency symbols
        currency = "unknown"
        for symbol, code in [("
quot;, "USD"), ("€", "EUR"), ("£", "GBP"), ("¥", "JPY"), ("₹", "INR")]: if symbol in content: currency = code break return GeoTestResult( country=country, url=url, status=resp.status_code, final_url=str(resp.url), content_language=resp.headers.get("content-language", "not set"), currency_detected=currency, response_time_ms=round(elapsed, 1), ) # Test from multiple countries COUNTRIES = ["US", "GB", "DE", "JP", "BR", "AU", "IN", "FR"] results = [run_geo_test("https://yoursite.com/pricing", c, "YOUR_USER", "YOUR_PASS") for c in COUNTRIES] for r in results: print(f"{r.country}: status={r.status}, currency={r.currency_detected}, redirected_to={r.final_url}")

Node.js Geo-Testing

const { HttpsProxyAgent } = require('https-proxy-agent');

async function geoTest(url, country, username, password) {
  const proxyUrl = `http://${username}-country-${country.toLowerCase()}:${password}@gate.hexproxies.com:8080`;
  const agent = new HttpsProxyAgent(proxyUrl);
  const start = Date.now();

  const response = await fetch(url, {
    agent,
    redirect: 'follow',
    headers: { 'Accept-Language': 'en-US,en;q=0.9' },
  });

  const body = await response.text();
  const elapsed = Date.now() - start;

  return {
    country,
    status: response.status,
    finalUrl: response.url,
    bodyLength: body.length,
    responseTimeMs: elapsed,
  };
}

const countries = ['US', 'GB', 'DE', 'JP', 'BR', 'AU'];
const results = await Promise.all(
  countries.map(c => geoTest('https://yoursite.com', c, 'YOUR_USER', 'YOUR_PASS'))
);

console.table(results);

Automated Geo-Testing in CI/CD

Integrate geo-tests into your CI pipeline to catch localization regressions before deployment:

def assert_geo_redirect(url: str, country: str, expected_redirect: str, username: str, password: str) -> bool:
    result = run_geo_test(url, country, username, password)
    if expected_redirect not in result.final_url:
        raise AssertionError(
            f"Expected {country} redirect to contain '{expected_redirect}', "
            f"got '{result.final_url}'"
        )
    return True

# CI assertions
assert_geo_redirect("https://yoursite.com", "DE", "/de/", "YOUR_USER", "YOUR_PASS")
assert_geo_redirect("https://yoursite.com", "JP", "/ja/", "YOUR_USER", "YOUR_PASS")
assert_geo_redirect("https://yoursite.com", "BR", "/pt/", "YOUR_USER", "YOUR_PASS")

Testing CDN Geo-Behavior

Verify your CDN serves content from the correct edge location and respects geo-based caching rules. Check response headers like CF-Ray, X-Cache, and X-Served-By from different geographic proxies to confirm proper CDN routing.

Hex Proxies' residential network covers 195+ countries, giving you comprehensive geographic coverage for testing any localization or geo-targeting implementation.

Tips

  • Use residential proxies for geo-testing — they provide genuine country-level IP addresses that CDNs and geo-IP services recognize correctly.
  • Test from at least 6-8 countries covering major regions: North America, Europe, Asia, South America.
  • Check both redirect behavior and final page content — a correct redirect to a broken page is still a bug.
  • Test with Accept-Language headers that match the target country for full localization coverage.
  • Run geo-tests after every deployment to catch localization regressions immediately.

Ready to Get Started?

Put this guide into practice with Hex Proxies.