turnstile

package
v1.121.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package turnstile passes Cloudflare's Turnstile the way a person does: when its widget asks whether the browser is human, it clicks the box.

Measured against MVGroup and Letterboxd (2026-10): a headed Chrome with a fresh profile is either let through or shown the checkbox, and a mouse click sent through the DevTools protocol passes the latter in a few seconds. Only the DOM and Input domains are used -- nothing is evaluated in the page while the widget is deciding, and no script domain is enabled for it to notice.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsolved = errors.New("challenge not solved")

ErrUnsolved is a challenge still standing when the time ran out.

Functions

func Solve

func Solve(ctx context.Context, caller cdp.Caller, sessionId string, done Done) error

Solve watches the page behind the session until done reports true, clicking Turnstile's checkbox whenever it is showing, has settled and has not just been clicked. The context bounds the wait; when it ends first the error is ErrUnsolved.

Types

type Done

type Done func(ctx context.Context) (bool, error)

Done reports whether the page is past what the widget was guarding: the challenge page gone, or a form's submit button enabled.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL