Browser Swarm Docs
  • 🚀Welcome
    • What is Browser Swarm?
  • Understanding Headless Browsers
  • Quickstart Guide
  • Framework Compatibility
  • 🌟 Core Concepts
    • Starting a Browser Task
  • Interacting with Browser Tasks
  • Task Lifecycle Management
  • ⚙️Advanced Features
    • Stealth Automation
  • Proxy Integration
  • Real-Time Monitoring
  • Responsive Viewports
  • Session Debugging & Replay
  • File Handling (Downloads & Uploads)
  • Capturing Screenshots & PDFs
  • Persistent Contexts
  • Extension Support
  • Session Tagging & Metadata
  • 🎯Practical Examples
    • Automating Form Interactions
  • Efficient Data Scraping
  • Automated Web Testing
  • Cost Optimization Strategies
  • Handling Extended Tasks
  • Selecting Execution Regions
  • Monitoring Resource Usage
  • Leveraging Task Metadata
  • Pricing and Subscription
  • Account and Team Management
  • Managing Limits and Concurrency
  • Authentication Automation
  • Security Best Practices
  • 🔌Ecosystem Integrations
    • Integration Overview
  • 💻Developer Resources
    • APIs and SDKs Overview
  • Node.js Integration
  • Python Integration
  • Browser Task API
  • Project Management API
  • Context Management API
  • Browser Extensions API
  • 🙋‍♂️Support & Resources
    • Getting Help
  • Dashboard Overview
  • FAQs & Troubleshooting
Powered by GitBook
On this page
  • 🧰 Proxy Configuration Options
  • Example
  • 🌍 Geolocation Control
  • ⚙️ Advanced Proxy Routing
  • 📊 Monitoring Proxy Usage
  • 💡 Best Practices

Proxy Integration

Browser Swarm provides flexible proxy integration options, allowing you to route your automation traffic through various proxy types to enhance anonymity, control geolocation, and improve reliability.


🧰 Proxy Configuration Options

With Browser Swarm, you can:

  • Use Built-in Proxies: Effortlessly route traffic through our managed residential proxies.

  • Bring Your Own Proxies: Utilize custom HTTP/HTTPS proxies for greater control over network routing.

  • Combine Multiple Proxies: Set custom routing rules to direct traffic through different proxies based on domain or location.

Proxies are configured when creating a session through the API or SDK.


Example

import { BrowserSwarm } from 'browser-swarm-sdk';

const bs = new BrowserSwarm({ apiKey: process.env.BROWSER_SWARM_API_KEY });

const session = await bs.sessions.create({
  projectId: process.env.BROWSER_SWARM_PROJECT_ID,
  proxies: [
    {
      type: 'custom',
      url: 'http://username:password@proxy.example.com:8080'
    }
  ]
});
from browser_swarm import BrowserSwarm
import os

bs = BrowserSwarm(api_key=os.environ["BROWSER_SWARM_API_KEY"])

session = bs.sessions.create(
    project_id=os.environ["BROWSER_SWARM_PROJECT_ID"],
    proxies=[
        {
            "type": "custom",
            "url": "http://username:password@proxy.example.com:8080"
        }
    ]
)

🌍 Geolocation Control

To simulate browsing from specific locations, you can configure proxies with geolocation settings:

proxies: [
  {
    type: 'browserbase',
    geolocation: {
      city: 'New York',
      state: 'NY',
      country: 'US'
    }
  }
]

This setup is particularly useful for testing localized content or accessing region-restricted websites.


⚙️ Advanced Proxy Routing

For more granular control, Browser Swarm allows domain-specific proxy routing:

proxies: [
  {
    type: 'custom',
    url: 'http://proxy1.example.com:8080',
    domains: ['example.com', 'testsite.com']
  },
  {
    type: 'custom',
    url: 'http://proxy2.example.com:8080',
    domains: ['anothersite.com']
  }
]

This configuration directs traffic to specified domains through designated proxies, optimizing performance and reliability.


📊 Monitoring Proxy Usage

Track your proxy data consumption via the Browser Swarm Dashboard, which provides real-time insights into:

  • Data Usage: Monitor the amount of data transmitted through proxies.

  • Session Metrics: Analyze session durations, statuses, and resource consumption.

  • Geolocation Distribution: Visualize traffic distribution across different regions.

Regular monitoring helps in optimizing proxy usage and managing associated costs.


💡 Best Practices

  • Rotate Proxies: Regularly change proxies to avoid IP bans and maintain anonymity.

  • Use Residential Proxies: For higher success rates, especially when dealing with sophisticated anti-bot systems.

  • Monitor Performance: Keep an eye on proxy response times and success rates to ensure optimal performance.

By effectively integrating proxies into your browser automation workflows, Browser Swarm empowers you to navigate the web with enhanced control and reliability.

PreviousStealth AutomationNextReal-Time Monitoring

Last updated 1 month ago