Skip to content

/connect Endpoint

The /connect endpoint is the simplest way to use rayobrowse. Make an HTTP GET request, receive a CDP WebSocket URL as plain text, then pass that URL to Playwright, Puppeteer, Selenium, or any other CDP client.

The same protocol works locally and in cloud. Local uses http://localhost:9222; cloud uses https://cloud.rayobrowse.com plus your API key.

Terminal window
curl "http://localhost:9222/connect?headless=true&os=windows"
# ws://localhost:9222/cdp/<session-id>

No SDK needed. Any CDP-capable tool can use the returned URL.

# pip install httpx playwright && playwright install
import httpx
from playwright.sync_api import sync_playwright
resp = httpx.get(
"http://localhost:9222/connect",
params={"headless": "true", "os": "windows"},
timeout=120,
)
resp.raise_for_status()
cdp_url = resp.text.strip()
with sync_playwright() as p:
browser = p.chromium.connect_over_cdp(cdp_url)
context = browser.contexts[0] if browser.contexts else browser.new_context()
page = context.pages[0] if context.pages else context.new_page()
page.goto("https://example.com")
print(page.title())
browser.close()
Parameter Default Example Description
headlesstrueheadless=falseRun with or without a visible browser window.
oslinuxos=windowsFingerprint OS: windows, linux, android, macos.
browser_namechromebrowser_name=chromeBrowser fingerprint type.
browser_version_minlatestbrowser_version_min=146Minimum Chrome version to emulate.
browser_version_maxlatestbrowser_version_max=146Maximum Chrome version to emulate.
proxynoneproxy=http://user:pass@host:portRoute browser traffic through an HTTP proxy.
browser_languageautobrowser_language=en-USAccept-Language value.
ui_languageautoui_language=en-USBrowser UI locale.
screen_width_minautoscreen_width_min=1366Minimum screen width.
screen_height_minautoscreen_height_min=768Minimum screen height.
vncfalsevnc=trueReturn an x-vnc-url header for live viewing.
keepAlivefalsekeepAlive=trueKeep the browser open across CDP disconnects.
sessionIdnonesessionId=br_...Reconnect to an existing keep-alive session.
maxLifetimenonemaxLifetime=300Hard session TTL in seconds.
tokennonetoken=YOUR_API_KEYAPI key query parameter for cloud or authenticated deployments.

Examples

Windows fingerprint with proxy

curl "http://localhost:9222/connect?headless=true&os=windows&proxy=http://user:pass@host:port"

Headful browser with VNC

curl -i "http://localhost:9222/connect?headless=false&os=windows&vnc=true"

Read the x-vnc-url response header and open that URL in your browser.

Reconnect to a keep-alive session

curl "http://localhost:9222/connect?sessionId=br_59245e8658532863&vnc=true"
  1. Created when you call GET /connect.
  2. Returned as a CDP WebSocket URL in the response body.
  3. Automated by connecting your CDP client to the returned URL.
  4. Closed when the CDP client disconnects or when you call POST /api/browser/close.

Each connection gets a fresh browser instance with a new fingerprint profile.