httpclient

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: May 24, 2026 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package httpclient exposes the Chrome-TLS-fingerprinted HTTP client used throughout hermai-cli for anti-bot-friendly fetches.

This package is a thin re-export of internal/httpclient so external modules (hermai-api's hosted-fetch service, future SDK consumers) can import it — internal/ is still the canonical home, to keep the in-repo import graph unchanged. If the stealth client ever needs breaking changes, the in-repo callers move first and this shim follows.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Doer

type Doer = internal.Doer

Doer is the minimal interface hermai code uses for HTTP.

func MustNewStealth

func MustNewStealth(opts Options) Doer

MustNewStealth panics on construction failure. Only for tests and startup code where a fail is fatal.

func New

func New(opts Options) Doer

New returns a plain net/http client configured with the given options. Use this when you don't need TLS-fingerprinting.

func NewStealth

func NewStealth(opts Options) (Doer, error)

NewStealth returns a Chrome-TLS-fingerprinted client via bogdanfinn/tls-client. Use this against Cloudflare, Akamai, DataDome, and PerimeterX-protected hosts that rustle the JA3/JA4 of plain Go.

func NewStealthOrFallback

func NewStealthOrFallback(opts Options) Doer

NewStealthOrFallback returns a stealth client, falling back to the plain client on construction failure. Useful when the stealth fingerprint library might not be available on the target platform.

func NewStealthWithRedirects

func NewStealthWithRedirects(opts Options, maxRedirects int) (Doer, error)

NewStealthWithRedirects wraps a stealth client with a redirect follower that preserves the TLS fingerprint across the redirect chain. Stock net/http redirects would otherwise re-establish the connection with the default Go fingerprint on the hop.

type Options

type Options = internal.Options

Options configures a client. See internal/httpclient for field docs.

Jump to

Keyboard shortcuts

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