10% off ALL new Proxies – CODE: 10pro

Browser Use Proxy: Route AI Browser Agents via Mobile IPs

Browser Use Proxy: Route AI Browser Agents via Mobile IPs

Direct Answer

To route an AI browser agent through a mobile proxy, set the proxy on the Chromium session rather than the HTTP client. Browser Use, Stagehand and Browserbase each expose a proxy option — a server plus username/password — that you set once, and every page the agent opens travels over your German mobile IP.


Why Browser Agents Need a Different Proxy Setup

An AI browser agent — Browser Use, Stagehand, or a Browserbase-hosted session — is not a single HTTP request. It is a Chromium instance that the LLM drives step by step: open a page, read the DOM, click, type, navigate again. That means three things for the proxy layer:

  1. The proxy belongs in the browser launch, not the HTTP client. You configure it once on the Chromium process; every action the agent takes inherits it.
  2. The session needs IP stability. A multi-step task that hops IPs mid-flow looks inconsistent to the target site. A sticky session on a single dedicated endpoint keeps the whole task on one German mobile IP.
  3. Browsers leak. Chromium can reveal your real address through WebRTC and DNS even when the HTTP proxy is correctly set — so verification is part of the setup, not an afterthought.

This is where a mobile proxy earns its place. Mobile IPs sit behind carrier-grade NAT, so one IPv4 address is shared by thousands of real subscribers — which is exactly why German platforms tend to extend more IP trust to them than to datacenter ranges. For authorized automation that has to behave like an ordinary German visitor, that trust is the whole point.


Before You Start

You need four values from your GermanProxy.io account:

  • Host and port of your endpoint
  • Username and password

The examples below use PROXY_HOST, PORT, USER and PASS as placeholders — replace them with your own. A single dedicated endpoint is enough; you do not need a rotating pool for an agent. All examples use an HTTP(S) endpoint, which Chromium's --proxy-server accepts directly — see SOCKS5 vs HTTP proxy if you prefer SOCKS.


Browser Use — Set the Proxy on the Session

Browser Use drives Chromium through Playwright/Patchright. The proxy goes in the browser session config, exactly where Playwright expects it:

import asyncio

from browser_use import Agent, BrowserSession
from browser_use.llm import ChatOpenAI

async def main():
    # One dedicated German mobile endpoint for the whole agent run.
    browser_session = BrowserSession(
        proxy={
            "server": "http://PROXY_HOST:PORT",
            "username": "USER",
            "password": "PASS",
        },
    )

    agent = Agent(
        task="Open example.de and report the page title.",
        llm=ChatOpenAI(model="gpt-4o"),
        browser_session=browser_session,
    )

    # The LLM does the reasoning; every page it opens travels over the German mobile IP.
    result = await agent.run()
    print(result)
    await browser_session.close()

asyncio.run(main())

The proxy is set once, on the session — the model's reasoning is untouched, only the page traffic is routed. If your provider rejects credentials in the URL, keep server as the bare http://PROXY_HOST:PORT and pass username/password as separate fields, as above.


Stagehand — Local or Browserbase

Stagehand v3 talks to Chromium directly over CDP, so the proxy lives in the launch options for local runs and in the session-create parameters for remote ones. There are two modes. (In v3 you call stagehand.act(...) on the instance and reach the page through the context — stagehand.page and page.act were removed.)

Local Chromium — set localBrowserLaunchOptions.proxy:

import { Stagehand } from "@browserbasehq/stagehand";

const stagehand = new Stagehand({
  env: "LOCAL",
  model: "openai/gpt-5-mini",
  localBrowserLaunchOptions: {
    proxy: {
      server: "http://PROXY_HOST:PORT",
      username: "USER",
      password: "PASS",
    },
  },
});

await stagehand.init();
const page = stagehand.context.pages()[0];
await page.goto("https://www.example.de");
await stagehand.act("read the page title");
await stagehand.close();

Browserbase (remote) — the proxy is configured on the Browserbase session, not locally. Set env: "BROWSERBASE", provide your Browserbase project and API key, and pass your endpoint as a top-level proxies array of type external in browserbaseSessionCreateParams (this is the Browserbase session field, not browserSettings — and not proxies: true, which would select Browserbase's own managed proxies):

import { Stagehand } from "@browserbasehq/stagehand";

const stagehand = new Stagehand({
  env: "BROWSERBASE",
  apiKey: process.env.BROWSERBASE_API_KEY,
  projectId: process.env.BROWSERBASE_PROJECT_ID,
  model: "openai/gpt-5-mini",
  browserbaseSessionCreateParams: {
    proxies: [
      {
        type: "external",
        server: "http://PROXY_HOST:PORT",
        username: "USER",
        password: "PASS",
      },
    ],
  },
});

await stagehand.init();
const page = stagehand.context.pages()[0];
await page.goto("https://www.example.de");
await stagehand.act("read the page title");
await stagehand.close();

The same host, port and credentials apply either way — only the place you set them moves from your machine to the remote session.

For a deeper dive on Playwright proxy mechanics behind both tools, see the Python + Playwright guide. Selenium-based agents follow the same pattern via the Selenium guide, and Node-based stacks via the Node.js guide.


Verify the IP — and Plug the Leaks

A browser is not done when the HTTP proxy is set. Run these three checks before you scale a single agent into a fleet:

  1. IP echo. Have the agent open an IP-reflection page and confirm it returns a German mobile IP, not your own. If it returns your address, re-check the server value and that credentials reached the proxy.
  2. WebRTC. Chromium's WebRTC stack can expose your real local/public IP outside the proxy tunnel. Disable WebRTC or force it through the proxy. Read what a WebRTC leak is.
  3. DNS. If lookups resolve outside the tunnel, the target sees your resolver, not the proxy's. Route DNS through the proxy. Read what a DNS leak is.

There is a fourth, subtler signal: the passive OS fingerprint. A real German mobile IP carries a mobile-network fingerprint, which is consistent with a phone-shaped client — one more reason mobile beats datacenter for agent work. Use the test-your-setup guide to walk all of these in one pass.


Dedicated vs. Shared, Sticky vs. Rotation

For an agent, the defaults matter more than for a one-shot scraper, because the agent makes many dependent requests:

Decision For a browser agent Why
Dedicated vs. shared Dedicated for stateful, multi-step tasks One predictable German IP per task; no neighbour interference. Compare the two
Sticky vs. rotation Sticky during a task; rotate between tasks Mid-task IP changes look inconsistent to the target; a fresh IP per task spreads load
HTTP vs. SOCKS5 HTTP for most setups --proxy-server accepts both; HTTP is simplest. Compare
Mobile vs. residential vs. datacenter Mobile, for the CGNAT trust Why mobile wins for agents · ISP vs mobile
4G vs 5G 5G — our catalog is 5G-only 4G vs 5G explained

A GermanProxy.io endpoint gives you HTTP, SOCKS5 and an OpenVPN config, sticky sessions, on-demand rotation, and a fair-use allowance of 20 GB/day. For an agent that loads full pages with images and scripts, that data budget is the constraint to plan around — a single agent rendering rich pages can move several hundred MB an hour, so size your concurrency to the 20 GB/day rather than assuming headroom that isn't promised. We do not advertise "unlimited" traffic, because fair-use limits apply in practice and honesty is the point.


Use Agents Responsibly

A mobile proxy improves reliability for authorized automation — it is not a tool to defeat access controls, anti-bot systems, or platform security, and we don't position it as an "undetectable" agent. Keep your automation clean and defensible:

  1. Automate only what you're permitted to. Stay inside each site's terms and any contract or API you're granted. Web scraping for public data is generally lawful in the EU, but context matters — see is web scraping legal in the EU and are mobile proxies legal.
  2. Throttle. Add human-reasonable delays between agent actions so you don't overload a target server.
  3. Collect only what you need, and handle any personal data in line with the GDPR.
  4. Be honest about who you are. Don't impersonate a system you're not authorized to use.

[!IMPORTANT]
GermanProxy.io is a registered EU provider with a full imprint, clear acceptable-use rules, and a real abuse-reporting process. The service is IT routing — a host, port and credentials — not hardware you operate, and not framed as anonymity.


FAQ

Where do I set the proxy in Browser Use?

Browser Use drives Chromium through Playwright/Patchright, so the proxy goes in the browser launch options — pass proxy={server, username, password} to the BrowserSession (or the underlying launch args). The agent's LLM reasoning is unaffected; only the page traffic is routed through your German mobile IP.

Does Stagehand support a proxy?

Yes. For local runs (Stagehand v3), supply the proxy in localBrowserLaunchOptions.proxy. For remote runs on Browserbase, pass it as a top-level proxies array of type external inside browserbaseSessionCreateParams. The same endpoint and credentials work for both.

Do I need a rotating pool for an agent?

No. A single dedicated German mobile endpoint is usually the better fit — an agent's multi-step flow needs a stable IP (sticky session) so it isn't re-challenged on every action. Rotate on demand at the proxy when you start a fresh task, not mid-task.

How do I stop my real IP leaking past the proxy?

Browser agents can leak the real IP through WebRTC and DNS even when the HTTP proxy is set. Disable WebRTC or force it through the proxy, route DNS through the proxy, and verify with an IP-echo plus a leak test before relying on the setup. See the WebRTC-leak and DNS-leak guides.

HTTP or SOCKS5 for an agent?

Chromium's --proxy-server accepts both. HTTP(S) is simplest and works everywhere; SOCKS5 is useful when you need protocol-agnostic routing. For most Browser Use and Stagehand setups, HTTP is the path of least resistance — see the proxy protocol choice.


CTA

Run your AI browser agents on real German mobile IPs. Get a German mobile proxy — HTTP/SOCKS5/OpenVPN, sticky sessions, on-demand rotation, fair-use 20 GB/day, from a transparent EU provider. Browse the plans to get started. New to the topic? Start with what is a mobile proxy or the broader AI-agents use case.


Get a German mobile proxy: Real 4G/5G IPs from Germany, fair-use 20 GB/day — compare German mobile proxy plans or start with a dedicated 5G proxy.

Telegram Support
Nach oben scrollen