Versions in this module Expand all Collapse all v2 v2.1.0 Jul 29, 2024 Changes in this version + var DefaultBadPinHandler = func(req *http.Request) + var DefaultOptions = []HttpClientOption + var DefaultTimeoutSeconds = 30 + var ErrBadPinDetected = errors.New("bad ssl pin detected") + var H2SettingsMap = map[string]http2.SettingID + func GetSpecFactoryFromJa3String(ja3String string, ...) (func() (tls.ClientHelloSpec, error), error) + type BadPinHandlerFunc func(req *http.Request) + type CandidateCipherSuites struct + AeadId string + KdfId string + type CertificatePinner interface + Pin func(conn *tls.UConn, host string) error + func NewCertificatePinner(certificatePins map[string][]string) (CertificatePinner, error) + type ContextKeyHeader struct + type CookieJar interface + GetAllCookies func() map[string][]*http.Cookie + func NewCookieJar(options ...CookieJarOption) CookieJar + type CookieJarOption func(config *cookieJarConfig) + func WithAllowEmptyCookies() CookieJarOption + func WithDebugLogger() CookieJarOption + func WithLogger(logger Logger) CookieJarOption + func WithSkipExisting() CookieJarOption + type HttpClient interface + CloseIdleConnections func() + Do func(req *http.Request) (*http.Response, error) + Get func(url string) (resp *http.Response, err error) + GetBandwidthTracker func() bandwidth.BandwidthTracker + GetCookieJar func() http.CookieJar + GetCookies func(u *url.URL) []*http.Cookie + GetFollowRedirect func() bool + GetProxy func() string + Head func(url string) (resp *http.Response, err error) + Post func(url, contentType string, body io.Reader) (resp *http.Response, err error) + SetCookieJar func(jar http.CookieJar) + SetCookies func(u *url.URL, cookies []*http.Cookie) + SetFollowRedirect func(followRedirect bool) + SetProxy func(proxyUrl string) error + func NewHttpClient(logger Logger, options ...HttpClientOption) (HttpClient, error) + func ProvideDefaultClient(logger Logger) (HttpClient, error) + type HttpClientOption func(config *httpClientConfig) + func WithBandwidthTracker() HttpClientOption + func WithCatchPanics() HttpClientOption + func WithCertificatePinning(certificatePins map[string][]string, handlerFunc BadPinHandlerFunc) HttpClientOption + func WithCharlesProxy(host string, port string) HttpClientOption + func WithClientProfile(clientProfile profiles.ClientProfile) HttpClientOption + func WithConnectUserAgent(userAgent string) HttpClientOption + func WithCookieJar(jar http.CookieJar) HttpClientOption + func WithCustomRedirectFunc(redirectFunc func(req *http.Request, via []*http.Request) error) HttpClientOption + func WithDebug() HttpClientOption + func WithDefaultHeaders(defaultHeaders http.Header) HttpClientOption + func WithDialer(dialer net.Dialer) HttpClientOption + func WithDisableIPV4() HttpClientOption + func WithDisableIPV6() HttpClientOption + func WithForceHttp1() HttpClientOption + func WithInsecureSkipVerify() HttpClientOption + func WithLocalAddr(localAddr net.TCPAddr) HttpClientOption + func WithNotFollowRedirects() HttpClientOption + func WithProxyUrl(proxyUrl string) HttpClientOption + func WithRandomTLSExtensionOrder() HttpClientOption + func WithServerNameOverwrite(serverName string) HttpClientOption + func WithTimeout(timeout int) HttpClientOption + func WithTimeoutMilliseconds(timeout int) HttpClientOption + func WithTimeoutSeconds(timeout int) HttpClientOption + func WithTransportOptions(transportOptions *TransportOptions) HttpClientOption + type Logger interface + Debug func(format string, args ...any) + Error func(format string, args ...any) + Info func(format string, args ...any) + Warn func(format string, args ...any) + func NewDebugLogger(logger Logger) Logger + func NewLogger() Logger + func NewNoopLogger() Logger + type TransportOptions struct + DisableCompression bool + DisableKeepAlives bool + IdleConnTimeout *time.Duration + KeyLogWriter io.Writer + MaxConnsPerHost int + MaxIdleConns int + MaxIdleConnsPerHost int + MaxResponseHeaderBytes int64 + ReadBufferSize int + RootCAs *x509.CertPool + WriteBufferSize int