Skip to content

Connecting

The cloud /connect endpoint is an HTTP GET that creates a browser and returns the direct CDP WebSocket URL as plain text. No SDK required.

Request:

Terminal window
curl -v "https://cloud.rayobrowse.com/connect?os=windows&vnc=true" \
-H "x-api-key: YOUR_API_KEY"

Response:

< x-session-id: br_a7f3e91c20d84b01
< x-vnc-url: https://1.2.3.4:6080/vnc.html?path=vnc/br_a7f3e91c20d84b01
<
wss://1.2.3.4:9222/cdp/br_a7f3e91c20d84b01

The response body is the CDP WebSocket URL pointing directly at the browser. The x-vnc-url header gives you a link to watch the session live in your browser.

Then connect your CDP client to the URL in the body. Here are some examples:

import httpx
from playwright.sync_api import sync_playwright
resp = httpx.get(
"https://cloud.rayobrowse.com/connect",
params={"os": "windows"},
headers={"x-api-key": "YOUR_API_KEY"},
timeout=120,
)
resp.raise_for_status()
cdp_url = resp.text.strip()
with sync_playwright() as p:
browser = p.chromium.connect_over_cdp(cdp_url)
page = browser.new_page()
page.goto("https://example.com")
print(page.title())
browser.close()

Cloud supports the same /connect parameters as local mode. Use your API key with the x-api-key header, Authorization: Bearer, or token query parameter.

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.
HeaderDescription
x-session-idUnique session identifier (use for reconnection)
x-vnc-urlnoVNC URL (when vnc=true)
https://cloud.rayobrowse.com/connect?os=windows&proxy=http://user:pass@host:port
https://cloud.rayobrowse.com/connect?os=windows&vnc=true

The VNC URL is returned in the x-vnc-url response header.

The SDK wraps the /connect HTTP call and adds session management, reconnection, VNC URL retrieval, and typed errors. Only install it if you need those features.

from rayobrowse import Rayobrowse
from playwright.sync_api import sync_playwright
client = Rayobrowse(
endpoint="https://cloud.rayobrowse.com",
api_key="your-api-key",
)
ws_url = client.connect_url(
os="windows",
proxy="http://user:pass@host:port",
headless=True,
)
with sync_playwright() as p:
browser = p.chromium.connect_over_cdp(ws_url)
page = browser.new_page()
page.goto("https://example.com")
print(page.title())
browser.close()
client.close()
  1. Your code makes an HTTP GET to https://cloud.rayobrowse.com/connect
  2. The gateway creates a browser on one of the backend servers
  3. The response body contains the direct CDP WebSocket URL to the browser
  4. Response headers include x-session-id (for reconnection) and optionally x-vnc-url
  5. Your CDP client connects directly to the backend browser. The gateway is not in the data path after the initial /connect call