client

package
v0.0.0-...-d2ad19b Latest Latest
Warning

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

Go to latest
Published: May 15, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package client provides an *http.Client whose TLS handshake matches a persona's utls ClientHelloID.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(p persona.Persona, opts Options) *http.Client

New returns an *http.Client configured for the persona. The persona's User-Agent is set automatically unless the caller already set one.

func ParseProxy

func ParseProxy(s string) (*url.URL, error)

ParseProxy accepts both URL form ([scheme://][user:pass@]host:port) and the IP-rotation 4-part form (host:port:user:pass). Default scheme is http; pass socks5:// or https:// explicitly when needed.

Limitation: a 4-part password containing '@' is ambiguous with URL form and not supported — use URL form instead.

func SanitizeHost

func SanitizeHost(raw string) (string, error)

SanitizeHost validates a host string for CLI input.

Types

type ConnState

type ConnState struct {
	NegotiatedProtocol string
	CipherSuite        uint16
	PeerCertCommonName string
	Version            uint16
}

ConnState exposes a subset of TLS state for test introspection.

type Options

type Options struct {
	Timeout            time.Duration
	DialTimeout        time.Duration
	InsecureSkipVerify bool
	MaxBodyBytes       int64

	MinTLSVersion     uint16
	MaxTLSVersion     uint16
	ALPNOverride      []string // non-nil empty list suppresses ALPN
	SNIOverride       string   // "-" omits SNI entirely
	UserAgentOverride string
	ExtraHeaders      map[string]string
	DropHeaders       []string
	StripCookies      bool
	MethodOverride    string

	Proxy *url.URL // build with ParseProxy
}

Options tunes the client. The lower group are the per-probe axis-mutation knobs that hunt uses to vary one aspect of the connection at a time.

Jump to

Keyboard shortcuts

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