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.