CloakBrowser Hands-On: Bypass Cloudflare Turnstile in 30 Seconds

From pip install to your first Cloudflare Turnstile PASS — 3 lines of code, drop-in Playwright replacement, and proxy integration.

16Yun Engineering TeamApr 11, 20262 min read

Install

One command:

pip install cloakbrowser

On first launch, CloakBrowser auto-downloads the custom Chromium binary (~200MB, cached for subsequent runs).

For auto-detecting timezone and locale from your proxy IP:

pip install cloakbrowser[geoip]

Verify Installation

python -m cloakbrowser info

Expected output:

Version:  146.0.7680.177.5
Platform: linux-x64
Installed: True
Path:      /home/user/.cloakbrowser/chromium-146.0.7680.177.5/chrome

Force download if needed:

python -m cloakbrowser install

Docker Quick Test

docker run --rm cloakhq/cloakbrowser cloaktest

3 Lines to Replace Playwright

Migrating from existing Playwright code:

- from playwright.sync_api import sync_playwright
- pw = sync_playwright().start()
- browser = pw.chromium.launch()
+ from cloakbrowser import launch
+ browser = launch()

page = browser.new_page()
page.goto("https://example.com")
# ... rest of your code unchanged

launch() returns a standard Playwright Browser object. All standard APIs work.

With a Proxy

from cloakbrowser import launch

browser = launch(
    proxy="http://user:pass@proxy.16yun.cn:8888",
    geoip=True,     # match timezone/locale to proxy IP
    headless=False,
    humanize=True,  # human-like behavior
)

page = browser.new_page()
page.goto("https://example.com")

The proxy URL format follows the same convention as 16Yun's Crawler Proxy documentation: http://username:password@host:port.

Headless Considerations

Even with C++-level patches, some detection services run extra checks against headless mode:

  • General scraping: headless=True works for most sites
  • Cloudflare Turnstile or reCAPTCHA v3 Enterprise: Use headless=False
  • Maximum stealth: headless=False + humanize=True

Verify Turnstile PASS

Use the built-in test:

docker run --rm cloakhq/cloakbrowser cloaktest

Or in code:

from cloakbrowser import launch

browser = launch(headless=False)
page = browser.new_page()

page.goto("https://example.com")
page.wait_for_timeout(3000)

status = page.text_content(".challenge-result")
print(f"Turnstile: {status}")  # Expected: PASS

browser.close()

Published test results (CloakBrowser Chromium 146):

Detection ServiceResultNotes
Cloudflare Turnstile (non-interactive)✅ PASSAuto-resolve
Cloudflare Turnstile (managed)✅ PASSSingle click
reCAPTCHA v30.9 scoreServer-verified human
BrowserScan✅ Normal (4/4)All checks pass
FingerprintJS✅ Not flaggeddemo.fingerprint.com

Boost Success Rate with 16Yun Proxies

CloakBrowser solves "who you are"; proxies solve "where you are." Together they achieve the highest pass rate.

from cloakbrowser import launch

browser = launch(
    proxy="http://user:pass@proxy.16yun.cn:8888",
    geoip=True,        # auto-set timezone/locale from proxy IP
    headless=False,
    humanize=True,
)

page = browser.new_page()
page.goto("https://httpbin.org/ip")
print(page.text_content("body"))  # Confirm IP changed

geoip=True aligns the browser's timezone and locale with the proxy IP's geographic location. This eliminates an important fingerprint inconsistency — an exit IP in Tokyo shouldn't show Beijing time.

Proxy ProductBest ForCloakBrowser Setup
Crawler Proxy (tunnel)Large-scale page collectionproxy=http://user:pass@host:port, use Connection: Close for IP rotation
API ProxyCustom extraction strategyExtract IPs via API first, then pass dynamically to proxy param
Dedicated ProxyLong sessions, fixed exitproxy=http://user:pass@host:port + launch_persistent_context()

Troubleshooting

Binary not found

python -m cloakbrowser install

Proxy configured but IP unchanged

Verify the proxy URL format with curl:

curl -x http://user:pass@proxy.16yun.cn:8888 http://httpbin.org/ip

If curl returns the proxy's exit IP but CloakBrowser doesn't, check that the proxy parameter is passed to launch().

Turnstile still blocking

  • Disable headless mode
  • Enable humanize=True
  • Ensure you're using residential IPs, not datacenter IPs
  • The target may use managed Turnstile (click required) — humanize handles this

407 Proxy Authentication Required

This means proxy authentication failed. Per 16Yun's help documentation:

  1. Verify domain, port, username, and password are correct
  2. Confirm the proxy auth is properly configured in your code
  3. Test with the minimal example code first

Need an enterprise proxy plan?

We can tailor architecture to your target domains, concurrency, and reliability goals.