/connect Endpoint
The /connect endpoint is the simplest way to use rayobrowse. Connect any CDP client to a single URL — a browser is auto-created on connection and cleaned up when you disconnect.
Basic usage
Section titled “Basic usage”ws://localhost:9222/connect?headless=true&os=windowsNo SDK needed. Any CDP-capable tool (Playwright, Puppeteer, Selenium, OpenClaw, Scrapy) can connect directly.
# pip install playwright && playwright installfrom playwright.sync_api import sync_playwright
with sync_playwright() as p: browser = p.chromium.connect_over_cdp( "ws://localhost:9222/connect?headless=true&os=windows" ) page = browser.new_context().new_page() page.goto("https://example.com") print(page.title()) browser.close()// npm install playwrightconst { chromium } = require('playwright');
(async () => { const browser = await chromium.connectOverCDP( 'ws://localhost:9222/connect?headless=true&os=windows' ); const page = await browser.newPage(); await page.goto('https://example.com'); console.log(await page.title()); await browser.close();})();// npm install puppeteer-coreconst puppeteer = require('puppeteer-core');
(async () => { const browser = await puppeteer.connect({ browserWSEndpoint: 'ws://localhost:9222/connect?headless=true&os=windows', }); const page = (await browser.pages())[0] || await browser.newPage(); await page.goto('https://example.com'); console.log(await page.title()); await browser.disconnect();})();# pip install seleniumfrom selenium import webdriverfrom selenium.webdriver.chromium.options import ChromiumOptions
options = ChromiumOptions()options.debugger_address = "localhost:9222"
driver = webdriver.Remote( command_executor="http://localhost:9222/connect?headless=true&os=windows", options=options,)driver.get("https://example.com")print(driver.title)driver.quit()Parameters
Section titled “Parameters”| Parameter | Default | Description |
|---|---|---|
headless | true | true or false |
os | linux | Fingerprint OS: windows, linux, android, macos |
browser_name | chrome | Browser fingerprint type |
browser_version_min | (latest) | Minimum Chrome version |
browser_version_max | (latest) | Maximum Chrome version |
proxy | (none) | Proxy URL, e.g. http://user:pass@host:port |
browser_language | (auto) | Accept-Language value |
ui_language | (auto) | Browser UI locale |
screen_width_min | (auto) | Minimum screen width |
screen_height_min | (auto) | Minimum screen height |
api_key | (none) | Required in remote mode |
Examples
Section titled “Examples”Windows fingerprint with proxy
Section titled “Windows fingerprint with proxy”ws://localhost:9222/connect?headless=true&os=windows&proxy=http://user:pass@host:portHeadful mode (visible in noVNC)
Section titled “Headful mode (visible in noVNC)”ws://localhost:9222/connect?headless=false&os=windowsView at http://localhost:6080/vnc.html.
Specific Chrome version
Section titled “Specific Chrome version”ws://localhost:9222/connect?headless=true&os=windows&browser_version_min=146&browser_version_max=146Lifecycle
Section titled “Lifecycle”- Created when a CDP client connects to the
/connectWebSocket - Active while the WebSocket connection is alive
- Cleaned up automatically after the connection closes (2-second grace period)
Each connection gets a fresh browser instance with a new fingerprint profile.