Versions in this module Expand all Collapse all v1 v1.14.1 Apr 20, 2026 Changes in this version + const CHROME_MAX_FIELD_SECTION_SIZE + var DefaultBadPinHandler = func(req *http.Request) + var DefaultOptions = []HttpClientOption + var DefaultTimeoutSeconds = 30 + var ErrBadPinDetected = errors.New("bad ssl pin detected") + var ErrContinueHooks = errors.New("continue hooks") + var H2SettingsMap = map[string]http2.SettingID + var H3SettingsMap = map[string]uint64 + func GetSpecFactoryFromJa3String(ja3String string, ...) (func() (tls.ClientHelloSpec, error), error) + func Int64ToInt(x int64) (int, 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 + AddPostResponseHook func(hook PostResponseHookFunc) + AddPreRequestHook func(hook PreRequestHookFunc) + 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 + GetDialer func() proxy.ContextDialer + GetFollowRedirect func() bool + GetProxy func() string + GetTLSDialer func() TLSDialerFunc + Head func(url string) (resp *http.Response, err error) + Post func(url, contentType string, body io.Reader) (resp *http.Response, err error) + ResetPostHooks func() + ResetPreHooks func() + 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 WithConnectHeaders(headers http.Header) 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 WithDialContext(dialContext func(ctx context.Context, network, addr string) (net.Conn, error)) HttpClientOption + func WithDialer(dialer net.Dialer) HttpClientOption + func WithDisableHttp3() HttpClientOption + func WithDisableIPV4() HttpClientOption + func WithDisableIPV6() HttpClientOption + func WithForceHttp1() HttpClientOption + func WithInsecureSkipVerify() HttpClientOption + func WithLocalAddr(localAddr net.TCPAddr) HttpClientOption + func WithNotFollowRedirects() HttpClientOption + func WithPostHook(hook PostResponseHookFunc) HttpClientOption + func WithPreHook(hook PreRequestHookFunc) HttpClientOption + func WithProtocolRacing() HttpClientOption + func WithProxyDialerFactory(proxyDialerFactory ProxyDialerFactory) 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 PostResponseContext struct + Error error + Request *http.Request + Response *http.Response + type PostResponseHookFunc func(ctx *PostResponseContext) error + type PreRequestHookFunc func(req *http.Request) error + type ProxyDialerFactory func(proxyUrlStr string, timeout time.Duration, localAddr *net.TCPAddr, ...) (proxy.ContextDialer, error) + type TLSDialerFunc func(ctx context.Context, network, addr string) (net.Conn, error) + 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 + type Websocket struct + func NewWebsocket(logger Logger, options ...WebsocketOption) (*Websocket, error) + func (w *Websocket) Connect(ctx context.Context) (*websocket.Conn, error) + type WebsocketOption func(config *websocketConfig) + func WithCookiejar(cookiejar http.CookieJar) WebsocketOption + func WithHandshakeTimeoutMilliseconds(timeout int) WebsocketOption + func WithHeaders(headers http.Header) WebsocketOption + func WithReadBufferSize(readBufferSize int) WebsocketOption + func WithTlsClient(tlsClient HttpClient) WebsocketOption + func WithUrl(url string) WebsocketOption + func WithWriteBufferSize(writeBufferSize int) WebsocketOption