Connect URL
Connecting to a cdpfleet connect URL launches the browser and connects to it in one step, with no launch request first. Use it wherever a tool takes a WebSocket URL: Playwright's connect(), Playwright Test's wsEndpoint, connectOverCDP(), Puppeteer, and AI-agent frameworks that accept a CDP URL. The launch request keeps working as before.
The URL
wss://router01.cdpfleet.com/connect/<browser>?<options> # Playwright protocol (client 1.60; Rebrowser 1.52)
wss://router01.cdpfleet.com/connect/<browser>/cdp?<options> # CDP — Chrome, Edge, Brave, Opera, Yandex, Chromium
- API key: the
x-api-keyheader (Playwright and Puppeteer send headers on connect), or?api_key=for tools that can't send headers. - Options: the launch options as query parameters —
headless=new,channel=beta,profile=shop-login,record=false,proxy=cdpfleet-resi-country-us… Anything that isn't a plain string or true/false (objects, lists,proxy_rules, Camoufoxconfig) goes as onelaunch=parameter: the JSON launch body, base64url-encoded — or in anx-cdpfleet-launchheader as plain JSON. The code builder's Connect URL style writes the URL for you. - Proxies in URLs: URLs end up in logs, so prefer tokens without passwords —
cdpfleet-resi…,cdpfleet-plan…, a saved VPN name — or leaveproxyout for the free Community proxy.
Examples
// Playwright (Node.js)
const browser = await chromium.connect('wss://router01.cdpfleet.com/connect/chrome?proxy=cdpfleet-resi-country-us&headless=new', { headers: { 'x-api-key': process.env.CDPFLEET_API_KEY } });
// Playwright Test — playwright.config.ts: every worker gets its own browser
use: { connectOptions: { wsEndpoint: 'wss://router01.cdpfleet.com/connect/chrome?proxy=cdpfleet-resi-country-us&headless=new', headers: { 'x-api-key': process.env.CDPFLEET_API_KEY } } },
// CDP: connectOverCDP (any Playwright version) or Puppeteer
const browser = await chromium.connectOverCDP('wss://router01.cdpfleet.com/connect/chrome/cdp?headless=new', { headers: { 'x-api-key': process.env.CDPFLEET_API_KEY } });
const browser = await puppeteer.connect({ browserWSEndpoint: 'wss://router01.cdpfleet.com/connect/chrome/cdp?headless=new', headers: { 'x-api-key': process.env.CDPFLEET_API_KEY } });
Python: p.chromium.connect(url, headers={"x-api-key": key}). Java, C# and Go connect the same way with their own headers option — the code builder writes all five.
What happens
- The connection runs the same launch as
POST /<browser>/session: same options, limits, billing and errors. The session starts when the browser is ready and ends when the connection closes, unlesskeep_aliveis set. - Busy: if you're at your thread limit (
429 threads_exceeded) or the fleet is momentarily busy (503), the connection waits and retries for up to 60 seconds before giving up — client libraries don't retry these themselves. - Refused: any other error (bad option, plan limits, no key) refuses the connection with the same status and JSON body as the launch request; libraries show it in the connection error (for example
401 Unauthorized). - The session id comes back in the
x-cdpfleet-session-idresponse header; it's also in the dashboard andGET /v1/me/threads. - For live links,
keep_alivereconnects or anything else that needs the launch response, use the launch request.