Geo-Restriction Solution for Casino Website

Job ID: 39360408

Budget: $250 – $750 USD

Problem Description

I’m building a casino website that integrates with multiple third-party game providers via iframe. One of the key challenges I’m facing is geo-restriction:
Some of these providers block access to their game domains based on the user’s IP location.

---

What Works

1. I call the provider’s `api/login` endpoint from my backend server.
2. This returns a login URL (with a token) that allows launching the game.
3. I embed this login URL inside an `<iframe>` on the frontend.
4. The iframe loads the login URL and successfully logs the player in.

---

What Goes Wrong

- After logging in, the game redirects to a different domain (like `gameX.provider.com`).
- This final domain is geo-blocked, so users in restricted regions get blocked after redirection, even though login succeeded.
- Simply proxying the initial login URL is not enough, because the iframe follows the redirect and makes direct requests to the final domain — bypassing my server and any proxy I set.

---

Key Findings

- If I use a Chrome VPN extension, the entire game works perfectly.
- This proves that all network traffic must go through a residential IP (like VPN/proxy) — not just the first request.
- However, I cannot require users to install a VPN extension.
- So I need a way to transparently proxy iframe traffic, including all redirects and internal requests.

---

Current Attempt

I bought residential proxies (IP, port, username, password) and built a Node.js server that proxies iframe traffic.

But I realized that:
- If the game’s iframe content redirects the browser (via HTTP 302 or JS), the browser leaves the iframe’s current `src`, and starts making requests outside my proxy.
- Once this happens, I lose control — and geo-blocking kicks in.

---

Solution I’m Building

I am now building a dynamic proxy server that:
- Intercepts all iframe traffic.
- Uses my residential proxy (via `https-proxy-agent`) for every outbound request.
- Detects and rewrites redirects (like `302 Location: https://newdomain.com`) so they are routed back through the proxy (`/proxy?url=...`).
- Optionally parses and rewrites HTML so `src`, `href`, `action` attributes also stay inside the proxy.

This way:
- The iframe’s content is always requested via my proxy server.
- The player sees the full game, even if it loads assets or redirects to new domains.
- The residential proxy hides the player’s real IP.

---

Remaining Challenges

- Making sure all game domains, redirects, and internal API requests go through the proxy.
- Handling JS-based navigation (`window.location`, etc.) in some games.
- Supporting potential WebSockets or POST requests, if games use them.
- Possibly scaling performance for multiple concurrent players.

---

TL;DR (For Forum Title / Summary)

> I’m embedding a casino game provider in an iframe, but geo-blocking occurs after redirecting to a different domain. How can I keep all iframe traffic — including redirects — behind a residential proxy without user VPN?



Ongoing discussion: https://github.com/orgs/community/discussions/158010