Lightpanda Cloud proxy routing: how do I set proxy=datacenter and country=de in the CDP connection string?
Headless Browser Infrastructure

Lightpanda Cloud proxy routing: how do I set proxy=datacenter and country=de in the CDP connection string?

5 min read

When you run automation at cloud scale, proxy routing stops being a “nice to have” and becomes an operational primitive. In Lightpanda Cloud, proxy selection is just part of the CDP WebSocket URL, so setting proxy=datacenter with a German IP (country=de) is a matter of tweaking the connection string—nothing else in your Puppeteer/Playwright/chromedp script needs to change.

Below I’ll walk through the exact CDP URL format, how proxy and country interact, and copy‑paste examples for each major client.


How proxy routing works in Lightpanda Cloud

Lightpanda Cloud exposes regioned CDP endpoints:

  • EU West:
    wss://euwest.cloud.lightpanda.io/ws
  • US West:
    wss://uswest.cloud.lightpanda.io/ws

You always append your token as a query string parameter:

wss://euwest.cloud.lightpanda.io/ws?token=YOUR_TOKEN

From there, you can add more query parameters to configure the browser:

  • browser – choose between Lightpanda and Chrome:
    • default: Lightpanda
    • browser=lightpanda – force Lightpanda
    • browser=chrome – use Google Chrome
  • proxy – choose the proxy mode:
    • default: fast_dc (single shared datacenter IP)
    • proxy=datacenter – pool of shared datacenter IPs, auto‑rotating
  • country – refine datacenter with a specific country:
    • optional, 2‑letter country code (e.g., de, fr, us)
    • only meaningful when proxy=datacenter

Those parameters simply compose into one URL—no separate proxy config object, no extra client‑side plumbing.


Exact CDP URL for proxy=datacenter and country=de

To use the datacenter pool with German IPs in EU West, the full CDP URL is:

wss://euwest.cloud.lightpanda.io/ws?proxy=datacenter&country=de&token=YOUR_TOKEN

Key points:

  • proxy=datacenter tells Lightpanda to use a rotating pool of shared datacenter IPs.
  • country=de constrains that pool to German IPs.
  • token=YOUR_TOKEN authenticates your session.
  • Parameter order doesn’t matter; the above is just a clear, consistent pattern.

If you also want to force Chrome instead of Lightpanda in Cloud:

wss://euwest.cloud.lightpanda.io/ws?browser=chrome&proxy=datacenter&country=de&token=YOUR_TOKEN

Or to force Lightpanda explicitly:

wss://euwest.cloud.lightpanda.io/ws?browser=lightpanda&proxy=datacenter&country=de&token=YOUR_TOKEN

Puppeteer example (connect via browserWSEndpoint)

You can keep your existing Puppeteer logic. Only the browserWSEndpoint changes.

import puppeteer from "puppeteer-core";

const TOKEN = process.env.LIGHTPANDA_TOKEN!;

(async () => {
  const browser = await puppeteer.connect({
    browserWSEndpoint:
      `wss://euwest.cloud.lightpanda.io/ws` +
      `?proxy=datacenter&country=de&token=${TOKEN}`,
  });

  const page = await browser.newPage();
  await page.goto("https://example.com", { waitUntil: "networkidle2" });

  // ... your automation logic

  await browser.close();
})();

If you want Chrome for compatibility edge cases:

const browser = await puppeteer.connect({
  browserWSEndpoint:
    `wss://euwest.cloud.lightpanda.io/ws` +
    `?browser=chrome&proxy=datacenter&country=de&token=${TOKEN}`,
});

The rest of your script remains the same.


Playwright example (connectOverCDP)

Playwright’s connectOverCDP works the same way: plug in the CDP URL and you’re done.

import playwright from "playwright-core";

const TOKEN = process.env.LIGHTPANDA_TOKEN!;

(async () => {
  const browser = await playwright.chromium.connectOverCDP(
    `wss://euwest.cloud.lightpanda.io/ws` +
      `?proxy=datacenter&country=de&token=${TOKEN}`,
  );

  const context = await browser.newContext();
  const page = await context.newPage();

  await page.goto("https://example.com", { waitUntil: "networkidle" });

  // ... your automation logic

  await browser.close();
})();

Chrome option:

const browser = await playwright.chromium.connectOverCDP(
  `wss://euwest.cloud.lightpanda.io/ws` +
    `?browser=chrome&proxy=datacenter&country=de&token=${TOKEN}`,
);

chromedp / Go example

With chromedp, you wire the same CDP URL into the allocator:

package main

import (
	"context"
	"log"

	"github.com/chromedp/chromedp"
)

func main() {
	token := "<YOUR_TOKEN>"

	wsURL := "wss://euwest.cloud.lightpanda.io/ws" +
		"?proxy=datacenter&country=de&token=" + token

	allocCtx, cancelAlloc := chromedp.NewRemoteAllocator(context.Background(), wsURL)
	defer cancelAlloc()

	ctx, cancel := chromedp.NewContext(allocCtx)
	defer cancel()

	if err := chromedp.Run(ctx,
		chromedp.Navigate("https://example.com"),
	); err != nil {
		log.Fatal(err)
	}
}

To switch to Chrome:

wsURL := "wss://euwest.cloud.lightpanda.io/ws" +
	"?browser=chrome&proxy=datacenter&country=de&token=" + token

Default vs. datacenter proxy behavior

When you don’t specify a proxy:

wss://euwest.cloud.lightpanda.io/ws?token=YOUR_TOKEN

Lightpanda Cloud uses:

  • fast_dc – a single shared datacenter IP.

When you explicitly choose:

  • proxy=datacenter – you get:
    • a pool of shared datacenter IPs,
    • automatic rotation handled by Lightpanda,
    • optional country targeting, e.g. country=de.

This is usually what you want for higher‑volume crawling and GEO‑sensitive workloads, where a single IP quickly becomes a bottleneck or a banning risk.


Recommended usage patterns and guardrails

If you’re routing through proxy=datacenter&country=de, you’re probably already thinking about scale. A few practical guidelines:

  • Respect robots.txt
    If you run the open‑source browser yourself, use --obey_robots to enforce robots policies. In Cloud, mirror that behavior in your scheduler: don’t fire thousands of concurrent sessions at a single host.

  • Control concurrency per target site
    Lightpanda makes cold starts effectively disappear (instant startup) and memory footprint small (~24MB peak vs ~207MB peak for Headless Chrome in our Puppeteer 100‑page test on an AWS m5.large). That means you can spin up more sessions; it also means you can DDOS a site by accident if you ignore rate.

  • Separate concerns with query parameters

    • Region (EU vs US) via hostname: euwest vs uswest
    • Browser engine via browser=lightpanda|chrome
    • Network surface via proxy / country Keep it all in the URL so your orchestration layer can template and rotate it easily.

Troubleshooting proxy=datacenter + country=de setups

If something looks off when you configure proxy=datacenter&country=de:

  1. Check token first
    Make sure token=YOUR_TOKEN is present and valid. A missing token is the most common failure mode.

  2. Verify parameter spelling
    They must be lowercase and exact:

    • proxy=datacenter (not data_center or data-centre)
    • country=de (two‑letter ISO code)
  3. Confirm the region choice

    • If most of your traffic targets European sites, prefer euwest.
    • If your targets are US‑centric, you can still use country=de from uswest, but latency will be higher; align region and GEO conditions with your workload.
  4. Check for special proxy needs
    If you need:

    • a dedicated IP block,
    • specific ASN ranges,
    • or your own proxy wired into Cloud, reach out and we can configure additional proxies or your own pool behind the same CDP pattern.

Summary: the minimal change that unlocks German datacenter routing

To answer the question directly: to set proxy=datacenter and country=de in a Lightpanda Cloud CDP connection, compose your WebSocket URL like this:

wss://euwest.cloud.lightpanda.io/ws?proxy=datacenter&country=de&token=YOUR_TOKEN

You can drop that URL into:

  • browserWSEndpoint for Puppeteer,
  • connectOverCDP for Playwright,
  • NewRemoteAllocator for chromedp,

and keep the rest of your automation code identical.

If you want to wire this into a new or existing fleet right now, you can start a Cloud session and plug that CDP URL into your scripts:

Get Started