Documentation
¶
Index ¶
Constants ¶
const BrowserUserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
BrowserUserAgent is the User-Agent string used across the codebase for requests to target websites. Centralised here to prevent version drift.
const DefaultTimeout = 30 * time.Second
Default timeout applied when Options.Timeout is zero.
Variables ¶
var DefaultProfile = profiles.Chrome_146
DefaultProfile is the browser TLS+HTTP/2 fingerprint used by stealth clients.
Functions ¶
Types ¶
type Doer ¶
Doer is the minimal interface for executing HTTP requests. Both *http.Client and *tlsClientAdapter satisfy this.
func MustNewStealth ¶
MustNewStealth is like NewStealth but panics on error (use in init paths).
func NewStealth ¶
NewStealth creates a Doer with browser TLS+HTTP/2 fingerprinting. Use for outbound requests to target websites where anti-bot detection may inspect TLS ClientHello and HTTP/2 SETTINGS frames.
func NewStealthOrFallback ¶
NewStealthOrFallback tries to create a stealth client; falls back to plain *http.Client on failure. Useful when fingerprinting is best-effort.
func NewStealthWithRedirects ¶
NewStealthWithRedirects creates a stealth Doer that follows redirects. tls-client is configured with WithNotFollowRedirects so we handle it ourselves to keep the adapter's *http.Response.Request accurate.