cfrefresh

package
v0.5.0-beta Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: MIT Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package cfrefresh provides automatic Cloudflare clearance refresh via FlareSolverr.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Scheduler

type Scheduler struct {
	// contains filtered or unexported fields
}

Scheduler periodically refreshes CF clearance via FlareSolverr.

func NewScheduler

func NewScheduler(runtime *config.Runtime, configStore *store.ConfigStore) *Scheduler

NewScheduler creates a CF refresh scheduler.

func (*Scheduler) Start

func (s *Scheduler) Start()

Start launches the background refresh goroutine.

func (*Scheduler) Stop

func (s *Scheduler) Stop()

Stop signals the background goroutine to stop and waits for it to finish.

func (*Scheduler) TriggerRefresh

func (s *Scheduler) TriggerRefresh()

TriggerRefresh requests an immediate CF refresh (non-blocking, debounced). Safe to call from any goroutine. Multiple rapid calls are coalesced.

type SolveResult

type SolveResult struct {
	Cookies     string // all cookies joined as "name=value; name=value"
	CFClearance string // cf_clearance cookie value
	UserAgent   string // browser user-agent string
	Browser     string // fingerprint like "chrome133"
}

SolveResult holds the extracted values from a successful FlareSolverr solve.

func SolveCFChallenge

func SolveCFChallenge(flaresolverrURL string, timeout int, proxyURL string) (*SolveResult, error)

SolveCFChallenge calls FlareSolverr to solve the Cloudflare challenge on grok.com. flaresolverrURL is the base URL of the FlareSolverr service (e.g. "http://localhost:8191"). timeout is the CF challenge timeout in seconds. proxyURL is optional.

Jump to

Keyboard shortcuts

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