Browserbase lets you run cloud browsers with the exact network identity you need. You should use this setup when you need to allowlist Browserbase traffic through your firewall or API gateway. By routing traffic through your own static proxy or VPN, you can:
  • Pass network traffic through allowlisted infrastructure
  • Control your browser’s IP address and location
  • Comply with internal security policies and firewalls

How to Route Browserbase Through Your VPN

Browserbase sessions can route traffic through your own static HTTP/HTTPS proxy. This allows you to control the outbound IP. If your systems only allow traffic from trusted IPs, simply allowlist the IP of your proxy.
  1. Deploy a VPN or proxy server in your trusted network
  2. Allowlist that IP in your firewall, backend, or third-party system
  3. Pass the proxy config into your Browserbase session
  4. Browserbase routes browser traffic through your proxy

Custom Proxy Configuration

create_session_with_proxy.js
import { Browserbase } from "@browserbasehq/sdk";

const bb = new Browserbase({ apiKey: process.env.BROWSERBASE_API_KEY! });

async function createSessionWithCustomProxies() {
  const session = await bb.sessions.create({
    projectId: process.env.BROWSERBASE_PROJECT_ID!,
    proxies: [
      {
        "type": "external",
        "server": "http://...",
        "username": "user",
        "password": "pass",
      }
    ]
  });
  return session;
}

const session = await createSessionWithCustomProxies();

Key Requirements

  • Your proxy must support HTTP or HTTPS
  • It must be accessible from Browserbase (public IP or via tunnel)
  • You must allow traffic from Browserbase to your proxy (firewall, VPN config, etc.)

Troubleshooting

If your session fails to connect:
  • Make sure your proxy server is publicly accessible or properly tunneled
  • Confirm the proxy IP is correctly allowlisted in your system
  • Check the proxy authentication credentials
  • Ensure you’re using HTTP or HTTPS (Socks5 proxies are not supported)
  • Try connecting to the proxy from a local machine to verify it works outside your network