
Lightpanda Cloud proxy routing: how do I set proxy=datacenter and country=de in the CDP connection string?
Most teams discover proxy routing in Lightpanda Cloud the hard way: they ship a crawler, hit a geo-fenced site, and realize their “cloud-scale” setup is still effectively one datacenter IP in one country. That’s exactly what the proxy=datacenter&country=de pattern is for: you keep your existing CDP client (Playwright, Puppeteer, chromedp), but tell Lightpanda Cloud to route traffic through a rotating pool of German datacenter IPs.
This guide walks through how to set proxy=datacenter and country=de in the CDP connection string, what that means operationally, and how to use it safely in production crawlers and agents.
How proxy routing works in Lightpanda Cloud
Lightpanda Cloud exposes a Chrome DevTools Protocol (CDP) endpoint you connect to over WebSocket:
- EU West region:
wss://euwest.cloud.lightpanda.io/ws - US West region:
wss://uswest.cloud.lightpanda.io/ws
You then configure behavior via query string parameters:
token=YOUR_TOKEN– required for authbrowser=– choose the browser engine- default: Lightpanda
browser=chrome– force Google Chromebrowser=lightpanda– force Lightpanda
proxy=– choose proxy routing behaviorcountry=– optional, refine proxy country when usingdatacenter
Because this is just a URL, your CDP client doesn’t need any special plugin. You pass a browserWSEndpoint (Puppeteer) or endpointURL/connectOverCDP (Playwright, chromedp), and the rest of your script stays the same.
Proxy modes: fast_dc vs datacenter
Lightpanda Cloud currently supports:
-
fast_dc(default)
Single shared datacenter IP. Lowest friction, but no rotation and no country control. -
datacenter
Pool of shared datacenter IPs with automatic rotation. Can be constrained to a specific country withcountry=XX(two-letter ISO code).
If you don’t specify proxy, you get fast_dc. If you want German IP rotation, you explicitly request:
proxy=datacenter&country=de
The exact CDP connection string for Germany (country=de)
To connect to the EU West Lightpanda Cloud region with:
- Lightpanda browser (default)
- Datacenter proxy pool
- German IPs
- Your auth token
use:
wss://euwest.cloud.lightpanda.io/ws?proxy=datacenter&country=de&token=YOUR_TOKEN
Key points:
proxy=datacenterselects the rotating datacenter pool.country=deconstrains that pool to German IPs.- Query parameter order doesn’t matter; all three must be present.
- You can swap
euwestforuswestif you prefer the US region.
Playwright example: proxy=datacenter&country=de
Using playwright-core and connectOverCDP:
import playwright from "playwright-core";
(async () => {
const token = process.env.LIGHTPANDA_TOKEN;
if (!token) throw new Error("Set LIGHTPANDA_TOKEN env var");
const endpoint = `wss://euwest.cloud.lightpanda.io/ws?proxy=datacenter&country=de&token=${token}`;
const browser = await playwright.chromium.connectOverCDP(endpoint);
const context = await browser.newContext();
const page = await context.newPage();
await page.goto("https://example.com", { waitUntil: "load" });
// Do your magic ✨
await browser.close();
})();
Notes:
chromium.connectOverCDPis the key entry point.- No other Playwright code changes are required.
- You can still use the rest of Playwright’s API (contexts, tracing, etc.).
Puppeteer example: proxy=datacenter&country=de
With Puppeteer’s connect and a browserWSEndpoint:
import puppeteer from "puppeteer-core";
(async () => {
const token = process.env.LIGHTPANDA_TOKEN;
if (!token) throw new Error("Set LIGHTPANDA_TOKEN env var");
const browserWSEndpoint =
`wss://euwest.cloud.lightpanda.io/ws?proxy=datacenter&country=de&token=${token}`;
const browser = await puppeteer.connect({ browserWSEndpoint });
const page = await browser.newPage();
await page.goto("https://example.com", { waitUntil: "networkidle2" });
// Scrape, test, or drive the page
await browser.close();
})();
You keep your Puppeteer script; you only swap the WebSocket endpoint from local Chrome to Lightpanda Cloud with the right query parameters.
chromedp example: proxy=datacenter&country=de
In Go with chromedp, you can connect via a remote allocator:
package main
import (
"context"
"log"
"os"
"github.com/chromedp/chromedp"
)
func main() {
token := os.Getenv("LIGHTPANDA_TOKEN")
if token == "" {
log.Fatal("Set LIGHTPANDA_TOKEN env var")
}
endpoint := "wss://euwest.cloud.lightpanda.io/ws?proxy=datacenter&country=de&token=" + token
allocCtx, cancelAlloc := chromedp.NewRemoteAllocator(context.Background(), endpoint)
defer cancelAlloc()
ctx, cancel := chromedp.NewContext(allocCtx)
defer cancel()
if err := chromedp.Run(ctx,
chromedp.Navigate("https://example.com"),
); err != nil {
log.Fatal(err)
}
}
Again, the only Lightpanda-specific part is the CDP WebSocket URL.
Choosing the browser: Lightpanda vs Chrome with the same proxy
You can use the same proxy and country flags regardless of whether you run:
- Lightpanda (built from scratch in Zig, headless-first, no rendering baggage)
- Google Chrome (for compatibility-heavy edge cases)
To run Chrome with German datacenter routing:
wss://euwest.cloud.lightpanda.io/ws?browser=chrome&proxy=datacenter&country=de&token=YOUR_TOKEN
To force Lightpanda explicitly:
wss://euwest.cloud.lightpanda.io/ws?browser=lightpanda&proxy=datacenter&country=de&token=YOUR_TOKEN
Operational pattern:
- Use Lightpanda by default for instant startup and low memory (we see ~2.3s vs 25.2s and ~24MB vs 207MB in a Puppeteer 100-page test on an EC2 m5.large).
- Fall back to Chrome only where you hit rendering quirks or legacy JS that needs it.
- Keep
proxyandcountrystable across both so your routing behavior doesn’t change when you flip the engine.
Common pitfalls when setting proxy=datacenter&country=de
A few things that tend to bite people:
1. Missing token parameter
This must be present:
...ws?proxy=datacenter&country=de&token=YOUR_TOKEN
Without token, the CDP handshake will fail.
2. Wrong country code format
- Use two-letter ISO country codes:
de,fr,us,gb, etc. - Lowercase is recommended (
de, notDE) for consistency.
If the country is unsupported, routing behavior may fall back to a default pool. If you need a specific geography that isn’t available by default, contact us to configure additional proxies.
3. Forgetting proxy=datacenter
Setting country=de without proxy=datacenter doesn’t have the intended effect. Always pair them:
?proxy=datacenter&country=de&token=...
4. Hardcoding the region
If your workloads split across EU and US, make the region configurable:
const region = process.env.LIGHTPANDA_REGION ?? "euwest";
const endpoint = `wss://${region}.cloud.lightpanda.io/ws?proxy=datacenter&country=de&token=${token}`;
Responsible use: robots.txt and rate limits
Lightpanda is built for machines, which means you can easily hit “too fast” territory:
- Respect
robots.txtwhen crawling. Locally, you can enforce this via--obey_robotswith the CLI; in Cloud, implement the same policy in your job runner. - Avoid high-frequency requesting from the same IP range. With a datacenter pool, you can generate very high concurrency; uncontrolled, that looks like a DDOS very quickly.
- When in doubt, spread load over time and keep concurrency per target domain reasonable.
The whole point of proxy routing is to unlock legitimate geo-sensitive automation, not to blast sites.
When to ask for custom proxy setups
The built-in datacenter pool with country=de covers most “I need German IPs” scenarios. You should reach out for custom configuration when:
- You need a dedicated IP (not shared pool) for compliance or allowlisting.
- You need specific providers or routing characteristics.
- You want multiple country pools in one project and tighter control per job.
Lightpanda Cloud supports additional proxies and custom configurations; if you’re operating at “millions of pages a day” scale, that usually pays for itself quickly in stability and lower operational surprises.
TL;DR: the one line you need
To route your Lightpanda Cloud sessions through a rotating datacenter IP pool in Germany, your CDP connection string should look like this:
wss://euwest.cloud.lightpanda.io/ws?proxy=datacenter&country=de&token=YOUR_TOKEN
Drop that URL into your existing CDP client (Playwright, Puppeteer, chromedp), keep the rest of your script unchanged, and you’ve just added geo-aware proxy routing to a browser that actually behaves like a cloud primitive.