flaresolverr

package
v0.0.0-...-b6b1527 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: GPL-3.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusOK    = "ok"
	StatusError = "error"
)

Variables

This section is empty.

Functions

func ResolveConfigPath

func ResolveConfigPath() (string, error)

func SaveConfig

func SaveConfig(cfg Config) (string, error)

Types

type ChallengeResolutionResult

type ChallengeResolutionResult = browserpkg.ChallengeResolutionResult

type Config

type Config struct {
	Host                string
	Port                int
	BrowserBackend      string // "auto" | "chromedriver" | "geckodriver"
	BrowserPath         string
	DriverPath          string
	DriverCacheDir      string
	DriverAutoDownload  bool
	ChromeForTestingURL string
	Headless            bool
	StartupUserAgent    string
	LogLevel            string
	LogHTML             bool
	DebugLogging        bool
	DisableMedia        bool
	PrometheusEnabled   bool
	PrometheusPort      int
	DefaultProxy        *Proxy
	Version             string
	Logger              *slog.Logger
}

func DefaultConfig

func DefaultConfig() Config

func LoadConfig

func LoadConfig() (Config, []string)

func PrepareConfig

func PrepareConfig(cfg Config) Config
type Cookie = browserpkg.Cookie

type HealthResponse

type HealthResponse struct {
	Status string `json:"status"`
}

type IndexResponse

type IndexResponse struct {
	Msg       string `json:"msg"`
	Version   string `json:"version"`
	UserAgent string `json:"userAgent"`
}

type Logger

type Logger interface {
	Debug(msg string, args ...any)
	Info(msg string, args ...any)
	Warn(msg string, args ...any)
	Error(msg string, args ...any)
}

type Proxy

type Proxy = browserpkg.Proxy

type Server

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

func NewServer

func NewServer(cfg Config) *Server

func (*Server) Handler

func (s *Server) Handler() http.Handler

func (*Server) ListenAndServe

func (s *Server) ListenAndServe() error

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

type Service

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

func NewService

func NewService(cfg Config) *Service

func (*Service) ApplyConfig

func (s *Service) ApplyConfig(cfg Config)

func (*Service) Close

func (s *Service) Close() error

func (*Service) ControllerV1

func (s *Service) ControllerV1(ctx context.Context, req *V1Request) (V1Response, int)

func (*Service) Health

func (*Service) Index

func (s *Service) Index(ctx context.Context) IndexResponse

type V1Request

type V1Request struct {
	Cmd               string   `json:"cmd,omitempty"`
	Cookies           []Cookie `json:"cookies,omitempty"`
	MaxTimeout        int      `json:"maxTimeout,omitempty"`
	Proxy             *Proxy   `json:"proxy,omitempty"`
	Session           string   `json:"session,omitempty"`
	SessionTTLMinutes int      `json:"session_ttl_minutes,omitempty"`
	Headers           any      `json:"headers,omitempty"`
	UserAgent         string   `json:"userAgent,omitempty"`

	URL               string `json:"url,omitempty"`
	PostData          string `json:"postData,omitempty"`
	ReturnOnlyCookies bool   `json:"returnOnlyCookies,omitempty"`
	ReturnScreenshot  bool   `json:"returnScreenshot,omitempty"`
	Download          *bool  `json:"download,omitempty"`
	ReturnRawHTML     *bool  `json:"returnRawHtml,omitempty"`
	WaitInSeconds     int    `json:"waitInSeconds,omitempty"`
	DisableMedia      *bool  `json:"disableMedia,omitempty"`
	TabsTillVerify    *int   `json:"tabs_till_verify,omitempty"`
}

type V1Response

type V1Response struct {
	Status         string                     `json:"status"`
	Message        string                     `json:"message"`
	Session        string                     `json:"session,omitempty"`
	Sessions       []string                   `json:"sessions,omitempty"`
	StartTimestamp int64                      `json:"startTimestamp,omitempty"`
	EndTimestamp   int64                      `json:"endTimestamp,omitempty"`
	Version        string                     `json:"version,omitempty"`
	Solution       *ChallengeResolutionResult `json:"solution,omitempty"`
}

Directories

Path Synopsis
geckodriver
Package geckodriverbackend implements the browser.Client interface on top of geckodriver + Firefox (typically daijro/camoufox).
Package geckodriverbackend implements the browser.Client interface on top of geckodriver + Firefox (typically daijro/camoufox).

Jump to

Keyboard shortcuts

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