v1.8.91-d84675c
← Back to Hex Proxies

Browser Use Framework Proxy Setup

Last updated: April 2026

By Hex Proxies Engineering Team

Configure Hex Proxies with Browser Use, the popular framework for LLM-powered browser automation. Covers proxy integration, session management, and production patterns.

intermediate20 minutesai-agents

Prerequisites

  • Python 3.10 or later
  • Browser Use package installed (pip install browser-use)
  • Hex Proxies account with residential proxy access
  • OpenAI or Anthropic API key for the LLM

Steps

1

Install Browser Use

Install the browser-use package: pip install browser-use playwright && playwright install

2

Configure proxy credentials

Set up Hex Proxies residential proxy credentials with geo-targeting matching your agent task requirements.

3

Initialize agent with proxy

Pass proxy configuration through browser_config when creating the Browser Use agent.

4

Implement session management

Create unique sticky sessions per agent task to maintain IP consistency within tasks.

5

Test and optimize

Run test tasks and verify proxy integration by checking the agent can access protected sites without blocks.

Browser Use Proxy Integration

Browser Use is a Python framework that enables LLMs (GPT-4, Claude, etc.) to control a web browser autonomously. The LLM receives screenshots and page content, then decides which actions to take -- clicking, typing, navigating, and extracting information.

For Browser Use to work reliably across diverse websites, it needs clean IP addresses that bypass anti-bot protections. Without proxies, Browser Use sessions run on your local or cloud IP, which gets blocked quickly when the agent browses multiple sites or makes rapid requests.

Why Browser Use Needs Proxies

Browser Use agents are particularly susceptible to IP-based blocking because:

  • **Rapid navigation**: LLM-driven agents navigate faster than typical humans, triggering behavioral rate limits.
  • **Cloud deployment**: Production Browser Use agents run on cloud servers with datacenter IPs that are blocked by default on many websites.
  • **Diverse targets**: A single agent task often requires visiting multiple websites (search engines, product pages, documentation), each with its own anti-bot protections.
  • **Session intensity**: Browser Use creates rich interaction patterns (scrolling, clicking, typing) that generate more requests per page than simple scraping.

Proxy Configuration

Browser Use uses Playwright internally for browser control. Configure proxies through the Browser Use agent initialization:

from browser_use import Agent

# Create agent with proxy configuration agent = Agent( task="Find the best flight from NYC to London for next month", llm=ChatOpenAI(model="gpt-4o"), browser_config={ "proxy": { "server": "http://gate.hexproxies.com:8080", "username": "user-country-us", "password": "your-password" } } )

result = await agent.run() ```

Sticky Sessions for Multi-Step Tasks

Browser Use agents often perform multi-step tasks that require consistent IP addresses. For example, searching for a product, comparing prices across sites, and then returning to the original site. Use sticky sessions to maintain IP consistency within a task:

import random

def create_session_proxy(country="us"): session_id = ''.join(random.choices(string.ascii_lowercase, k=8)) return { "server": "http://gate.hexproxies.com:8080", "username": f"user-country-{country}-session-{session_id}", "password": "your-password" }

# Each agent task gets its own sticky session proxy = create_session_proxy("us") agent = Agent( task="Compare laptop prices across Amazon, Best Buy, and Newegg", llm=ChatOpenAI(model="gpt-4o"), browser_config={"proxy": proxy} ) ```

Geo-Targeted Agent Tasks

For tasks requiring location-specific results (local search, regional pricing, geo-restricted content), use Hex Proxies geo-targeting:

# Agent sees web as a UK user
uk_proxy = {
    "server": "http://gate.hexproxies.com:8080",
    "username": "user-country-gb",
    "password": "your-password"

agent = Agent( task="Find the cheapest grocery delivery in London", llm=ChatOpenAI(model="gpt-4o"), browser_config={"proxy": uk_proxy} ) ```

Production Patterns

For production Browser Use deployments, implement:

  1. **Proxy rotation between tasks**: Create a new sticky session for each agent task to avoid IP carryover between unrelated tasks.

2. **Bandwidth monitoring**: Browser Use agents can consume 10-50 MB per task depending on the sites visited. Monitor through the Hex Proxies dashboard.

3. **Error recovery**: If the agent encounters a blocked page, instruct the LLM to report the block so your orchestration layer can retry with a different proxy.

4. **Resource optimization**: Configure Playwright to block images and non-essential resources to reduce bandwidth consumption:

browser_config={
    "proxy": proxy,
    "block_resources": ["image", "stylesheet", "font"]
}

Cost Estimation

Browser Use agents typically consume 10-50 MB per task. At $4.25/GB residential pricing: - Simple research tasks (3-5 pages): ~10 MB = $0.04 per task - Complex comparison tasks (10-20 pages): ~30 MB = $0.13 per task - Heavy browsing tasks (20+ pages): ~50 MB = $0.21 per task

For 1,000 agent tasks per day, expect $40-$210/day in proxy bandwidth costs.

Tips

  • *Create a new sticky session for each agent task to prevent IP contamination between unrelated tasks.
  • *Block images and non-essential resources to reduce proxy bandwidth by up to 60%.
  • *Use geo-targeting when the task requires location-specific results (local search, regional pricing).
  • *Monitor per-task bandwidth to identify tasks that consume excessive proxy bandwidth.
  • *Test the agent against a simple site first to verify proxy configuration before running complex tasks.

Ready to Get Started?

Put this guide into practice with Hex Proxies.

Cookie Preferences

We use cookies to ensure the best experience. You can customize your preferences below. Learn more