[cdpfleet](https://cdpfleet.com/) / [Browsers](https://cdpfleet.com/browsers) / Rebrowser

Chromium family · Stealth-patched Chromium

# Rebrowser, *one socket* away.

Chromium launched with Rebrowser's anti-detection patches. **Connect with Playwright 1.52** — this browser's server is pinned to 1.52 and newer clients time out on connect. The generated examples already use 1.52. `keep_alive` isn't available: the 1.52 server can't keep contexts across connections, so a launch with it returns 400. For the same reason `start_url` isn't offered: the page the server opens can't be handed to your code. `page.setContent()` never finishes on this browser (its patches replace the isolated world it runs in): use `page.goto('data:text/html,…')` or `page.evaluate(() => document.write(…))` instead.

[Open in the code builder](https://cdpfleet.com/docs/builder?browser=rebrowser)[Reference](https://cdpfleet.com/docs/browsers/rebrowser)

-   **/rebrowser/session**launch endpoint
-   **1.52**Playwright client
-   **1**thread headless

## Why Rebrowser

-   Chromium with **Rebrowser's anti-detection patches**.
-   Connect with the **Playwright 1.52** client — the code generator picks it for you.
-   No `keep_alive`: the 1.52 server can't keep contexts across connections.

## Versions on the fleet now

**release**1.52.0

One build per release, updated on the fleet as new versions ship.

New majors are announced on [/docs/updates](https://cdpfleet.com/docs/updates).

## Launch it

One HTTPS call to `POST /rebrowser/session` returns a WebSocket URL; connect to it with Playwright's `chromium.connect()` (client 1.52). A headless session takes 1 thread, a headful one 2.

Rebrowser: launch, open a page, print its title

 

```node
// npm install playwright@1.52.0
// Browsers run on cdpfleet, so no `npx playwright install` is needed.
import { chromium } from 'playwright';

const KEY = process.env.CDPFLEET_API_KEY;

// 1. Launch the browser
const res = await fetch('https://starter.cdpfleet.com/rebrowser/session', {
  method: 'POST',
  headers: { 'x-api-key': KEY, 'content-type': 'application/json' },
  body: JSON.stringify({
    proxy: 'http://user:pass@proxy.example.com:8080',
    headless: 'new',
  }),
});
if (!res.ok) throw new Error(`launch failed: ${res.status} ${await res.text()}`);
const { wsUrl } = await res.json();

// 2. Connect and drive it
const browser = await chromium.connect(wsUrl, { headers: { 'x-api-key': KEY } });
const page = await browser.newPage();
await page.goto('https://example.com');
console.log(await page.title());
await browser.close(); // ends the session and stops billing
```

```python
# pip install playwright==1.52.0 requests
# Browsers run on cdpfleet, so no `playwright install` is needed.
import os
import requests
from playwright.sync_api import sync_playwright

KEY = os.environ["CDPFLEET_API_KEY"]

# 1. Launch the browser
res = requests.post(
    "https://starter.cdpfleet.com/rebrowser/session",
    headers={"x-api-key": KEY},
    json={
        "proxy": "http://user:pass@proxy.example.com:8080",
        "headless": "new",
    },
    timeout=60,
)
res.raise_for_status()
ws_url = res.json()["wsUrl"]

# 2. Connect and drive it
with sync_playwright() as p:
    browser = p.chromium.connect(ws_url, headers={"x-api-key": KEY})
    page = browser.new_page()
    page.goto("https://example.com")
    print(page.title())
    browser.close()  # ends the session and stops billing
```

```java
// Maven: com.microsoft.playwright:playwright:1.52.0  and  com.google.code.gson:gson:2.11.0
// Run with PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1: browsers run on cdpfleet.
import com.google.gson.JsonParser;
import com.microsoft.playwright.*;
import java.net.URI;
import java.net.http.*;
import java.util.Map;

public class Example {
  public static void main(String[] args) throws Exception {
    String key = System.getenv("CDPFLEET_API_KEY");

    // 1. Launch the browser
    String body = """
        {
          "proxy": "http://user:pass@proxy.example.com:8080",
          "headless": "new"
        }
        """;
    HttpResponse<String> res = HttpClient.newHttpClient().send(
        HttpRequest.newBuilder(URI.create("https://starter.cdpfleet.com/rebrowser/session"))
            .header("x-api-key", key)
            .header("content-type", "application/json")
            .POST(HttpRequest.BodyPublishers.ofString(body))
            .build(),
        HttpResponse.BodyHandlers.ofString());
    if (res.statusCode() != 200) {
      throw new RuntimeException("launch failed: " + res.statusCode() + " " + res.body());
    }
    String wsUrl = JsonParser.parseString(res.body()).getAsJsonObject().get("wsUrl").getAsString();

    // 2. Connect and drive it
    try (Playwright playwright = Playwright.create()) {
      Browser browser = playwright.chromium().connect(wsUrl,
          new BrowserType.ConnectOptions().setHeaders(Map.of("x-api-key", key)));
      Page page = browser.newPage();
      page.navigate("https://example.com");
      System.out.println(page.title());
      browser.close(); // ends the session and stops billing
    }
  }
}
```

```csharp
// dotnet add package Microsoft.Playwright --version 1.52.0
// Browsers run on cdpfleet, so no `playwright install` is needed.
using System.Net.Http.Json;
using System.Text;
using System.Text.Json;
using Microsoft.Playwright;

var key = Environment.GetEnvironmentVariable("CDPFLEET_API_KEY")!;

// 1. Launch the browser
using var http = new HttpClient();
http.DefaultRequestHeaders.Add("x-api-key", key);
var body = """
    {
      "proxy": "http://user:pass@proxy.example.com:8080",
      "headless": "new"
    }
    """;
var res = await http.PostAsync("https://starter.cdpfleet.com/rebrowser/session",
    new StringContent(body, Encoding.UTF8, "application/json"));
if (!res.IsSuccessStatusCode)
    throw new Exception($"launch failed: {(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");
var wsUrl = (await res.Content.ReadFromJsonAsync<JsonElement>()).GetProperty("wsUrl").GetString()!;

// 2. Connect and drive it
using var playwright = await Playwright.CreateAsync();
var browser = await playwright.Chromium.ConnectAsync(wsUrl, new BrowserTypeConnectOptions
{
    Headers = new Dictionary<string, string> { ["x-api-key"] = key },
});
var page = await browser.NewPageAsync();
await page.GotoAsync("https://example.com");
Console.WriteLine(await page.TitleAsync());
await browser.CloseAsync(); // ends the session and stops billing
```

```go
// go get github.com/playwright-community/playwright-go@v0.5200.1
//
// One-time driver setup (needs Node.js 18+): playwright-go can no longer download the
// 1.52.0 driver itself, so build it from npm and point PLAYWRIGHT_DRIVER_PATH at it:
//   mkdir -p ~/.cache/pw-driver-1.52.0 && cd ~/.cache/pw-driver-1.52.0 &&
//     curl -sL https://registry.npmjs.org/playwright-core/-/playwright-core-1.52.0.tgz | tar xz &&
//     ln -sf "$(command -v node)" node
//   export PLAYWRIGHT_DRIVER_PATH=~/.cache/pw-driver-1.52.0
// Browsers run on cdpfleet, so no browsers are downloaded (SkipInstallBrowsers).
package main

import (
	"encoding/json"
	"fmt"
	"io"
	"log"
	"net/http"
	"os"
	"strings"

	"github.com/playwright-community/playwright-go"
)

func main() {
	key := os.Getenv("CDPFLEET_API_KEY")

	// 1. Launch the browser
	body := `{
	  "proxy": "http://user:pass@proxy.example.com:8080",
	  "headless": "new"
	}`
	req, _ := http.NewRequest("POST", "https://starter.cdpfleet.com/rebrowser/session", strings.NewReader(body))
	req.Header.Set("x-api-key", key)
	req.Header.Set("content-type", "application/json")
	res, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer res.Body.Close()
	if res.StatusCode != http.StatusOK {
		msg, _ := io.ReadAll(res.Body)
		log.Fatalf("launch failed: %s %s", res.Status, msg)
	}
	var session struct {
		WsURL string `json:"wsUrl"`
	}
	if err := json.NewDecoder(res.Body).Decode(&session); err != nil {
		log.Fatal(err)
	}

	// 2. Connect and drive it (Install fetches only the Playwright driver, once)
	opts := &playwright.RunOptions{SkipInstallBrowsers: true}
	if err := playwright.Install(opts); err != nil {
		log.Fatal(err)
	}
	pw, err := playwright.Run(opts)
	if err != nil {
		log.Fatal(err)
	}
	defer pw.Stop()
	browser, err := pw.Chromium.Connect(session.WsURL, playwright.BrowserTypeConnectOptions{
		Headers: map[string]string{"x-api-key": key},
	})
	if err != nil {
		log.Fatal(err)
	}
	page, err := browser.NewPage()
	if err != nil {
		log.Fatal(err)
	}
	if _, err := page.Goto("https://example.com"); err != nil {
		log.Fatal(err)
	}
	title, _ := page.Title()
	fmt.Println(title)
	browser.Close() // ends the session and stops billing
}
```

[This program on GitHub →](https://github.com/cdpfleet/cdpfleet/tree/main/examples/browsers/rebrowser)

## Launch options

| Option | What it does |
| --- | --- |
| [`proxy_rules`](https://cdpfleet.com/docs/browsers/rebrowser#opt-proxy_rules) | Send specific destination hosts through specific proxies. |
| [`inactivity_timeout`](https://cdpfleet.com/docs/browsers/rebrowser#opt-inactivity_timeout) | End the session after this long with no traffic on its WebSocket. |
| [`overall_timeout`](https://cdpfleet.com/docs/browsers/rebrowser#opt-overall_timeout) | Hard cap on the session's total lifetime, regardless of activity. |
| [`memory`](https://cdpfleet.com/docs/browsers/rebrowser#opt-memory) | Give the session 2, 3 or 4 times your plan's memory; it counts as that many times the threads. |
| [`downloads`](https://cdpfleet.com/docs/browsers/rebrowser#opt-downloads) | Keep every file the browser downloads, to fetch after the session. |
| [`vpn_tunnel`](https://cdpfleet.com/docs/browsers/rebrowser#opt-vpn_tunnel) | VPN Tunnel: UDP/WebRTC full support — all of the browser's traffic, UDP included, goes through the residential exit. |
| [`vpn`](https://cdpfleet.com/docs/browsers/rebrowser#opt-vpn) | Own network (dedicated plans): send all of the browser's traffic through your own VPN instead of a proxy. |
| [`headless`](https://cdpfleet.com/docs/browsers/rebrowser#opt-headless) | Run without a display. |
| [`live_view`](https://cdpfleet.com/docs/browsers/rebrowser#opt-live_view) | Make a headless session watchable and controllable from outside. |
| [`screen_size`](https://cdpfleet.com/docs/browsers/rebrowser#opt-screen_size) | Resolution of the session's own display (headful only). |
| [`record`](https://cdpfleet.com/docs/browsers/rebrowser#opt-record) | Opt this session out of recording with false. |

Every session also needs a `proxy` — yours, or the [residential proxy](https://cdpfleet.com/residential-proxy).

## Related

Cases, recipes, posts and comparisons about this — updated as new ones are published.

### Reference docs

The details, options and errors.

-   [Rebrowser reference](https://cdpfleet.com/docs/browsers/rebrowser)Versions and every launch option.
-   [Quickstart](https://cdpfleet.com/docs/quickstart)Your first session in five minutes.

### Recipes 1

Complete programs for one setup each.

-   [Rebrowser with the Playwright 1.52 client](https://cdpfleet.com/docs/examples#rebrowser)Rebrowser is a patched Chromium that needs the 1.52 Playwright client — the generator picks it for you. Headful by default (2 threads); see \[stealth…[Code on GitHub](https://github.com/cdpfleet/cdpfleet/tree/main/examples/recipes/rebrowser)

### Browser comparisons 1

Measured side by side on the fleet.

-   [Patchright vs Rebrowser](https://cdpfleet.com/docs/compare/patchright-vs-rebrowser)Two stealth-patched Chromium builds that look the same to a site — same TLS and HTTP/2 fingerprints, no webdriver, no Runtime.enable leak — but Patchright is…

## Read next

[Browsers →](https://cdpfleet.com/browsers)[Google Chrome →](https://cdpfleet.com/browsers/chrome)[Microsoft Edge →](https://cdpfleet.com/browsers/edge)[Brave →](https://cdpfleet.com/browsers/brave)

---
Source: https://cdpfleet.com/browsers/rebrowser · Markdown: https://cdpfleet.com/browsers/rebrowser.md · All docs for AI tools: https://cdpfleet.com/llms.txt
