Skip to main content

CDP WebSocket Proxy

After creating a session, connect to the CDP WebSocket endpoint to control the browser.

Endpoint

The wsEndpoint returned by POST /v1/sessions includes the full URL with token. Pass it directly to Playwright or Puppeteer.

Authentication

The WebSocket proxy authenticates via the token query parameter (not the API key). The token is returned in the session creation response and is tied to that specific session.

Playwright

Puppeteer

Raw CDP

Blocked CDP Commands

The proxy filters dangerous CDP commands for security. These methods are blocked and return a JSON-RPC error: All other CDP methods (Page, Runtime, Network, DOM, etc.) pass through normally.

Error Response for Blocked Commands

Connection Lifecycle

  • Connect: Playwright/Puppeteer opens a WebSocket to the proxy URL
  • Relay: The proxy authenticates the token and relays CDP frames to the browser
  • Disconnect: When either side closes, the other is also closed
  • Timeout: Sessions auto-close after the configured timeout

Stealth

The browser has anti-bot stealth active regardless of which client connects:
  • navigator.webdriver = false
  • Navigator/WebGL/WebRTC spoofing
  • Chrome plugin array simulation
These are injected at the browser level and apply to all pages, including new pages created by Playwright/Puppeteer.