Documentation
ΒΆ
Index ΒΆ
- Variables
- func DecompressBody(res *http.Response)
- type Client
- func (c *Client) AddPostHooks(hooks ...PostHook)
- func (c *Client) AddPreHooks(hooks ...PreHook)
- func (c *Client) Clone() *Client
- func (c *Client) CloseIdleConnections()
- func (c *Client) DeletePostHooks()
- func (c *Client) DeletePreHooks()
- func (c *Client) Do(req *http.Request) (*http.Response, error)
- func (c *Client) Get(url string) (*http.Response, error)
- func (c *Client) GetCookieJar() http.CookieJar
- func (c *Client) GetCookies(u *url.URL) []*http.Cookie
- func (c *Client) GetProxy() any
- func (c *Client) GetSiteCookies(u *url.URL) []*http.Cookie
- func (c *Client) Head(url string) (*http.Response, error)
- func (c *Client) IsInHook() bool
- func (c *Client) Post(url, contentType string, body io.Reader) (*http.Response, error)
- func (c *Client) PostForm(url string, data url.Values) (*http.Response, error)
- func (c *Client) ResetInHook()
- func (c *Client) SetCookieJar(jar http.CookieJar)
- func (c *Client) SetCookies(u *url.URL, cookies []*http.Cookie)
- func (c *Client) SetFollowRedirects(follow bool)
- func (c *Client) SetInHook(b bool)
- func (c *Client) SetPostHooks(hooks ...PostHook)
- func (c *Client) SetPreHooks(hooks ...PreHook)
- func (c *Client) SetProxy(v any) error
- func (c *Client) SetRedirectFunc(f func(req *http.Request, via []*http.Request) error)
- type Option
- func WithAutoPinning() Option
- func WithCookieJar(jar http.CookieJar) Option
- func WithNoAutoDecompress() Option
- func WithNoCookieJar() Option
- func WithNoFollowRedirects() Option
- func WithPinner(pinner *Pinner) Option
- func WithQUICConfig(quicConf *quic.Config) Option
- func WithTLSConfig(tlsConf *tls.Config) Option
- func WithTimeout(timeout time.Duration) Option
- func WithTracker(tracker bandwidth.Tracker) Option
- func WithTransportOptions(opts TransportOptions) Option
- type Pinner
- type PostHook
- type PreHook
- type ProxyError
- type RoundTripper
- type TransportOptions
Constants ΒΆ
This section is empty.
Variables ΒΆ
View Source
var ErrCertificatePinningFailed = errors.New("tlsclient: certificate pinning failed")
Functions ΒΆ
func DecompressBody ΒΆ
Types ΒΆ
type Client ΒΆ
func (*Client) AddPostHooks ΒΆ added in v1.7.1
func (*Client) AddPreHooks ΒΆ added in v1.7.1
func (*Client) CloseIdleConnections ΒΆ
func (c *Client) CloseIdleConnections()
func (*Client) DeletePostHooks ΒΆ added in v1.7.1
func (c *Client) DeletePostHooks()
func (*Client) DeletePreHooks ΒΆ added in v1.7.1
func (c *Client) DeletePreHooks()
func (*Client) GetCookieJar ΒΆ
func (*Client) GetProxy ΒΆ
GetProxy returns the current proxy value. The type depends on what was passed to SetProxy: *url.URL for proxy URLs, net.IP for single direct IPs, or [2]net.IP for dual-stack.
func (*Client) GetSiteCookies ΒΆ added in v1.8.3
func (*Client) ResetInHook ΒΆ
func (c *Client) ResetInHook()
func (*Client) SetCookieJar ΒΆ
func (*Client) SetFollowRedirects ΒΆ
func (*Client) SetPostHooks ΒΆ added in v1.7.1
func (*Client) SetPreHooks ΒΆ added in v1.7.1
func (*Client) SetProxy ΒΆ
SetProxy configures the proxy/dialer for the client. Accepted types:
- *url.URL: proxy URL (http, https, socks5) or bare IP (no scheme) for direct binding
- net.IP: direct connection bound to a single local IP
- [2]net.IP: dual-stack direct connection bound to IPv4 ([0]) and IPv6 ([1])
- nil: direct connection with no local address binding
type Option ΒΆ
type Option func(*Client)
func WithAutoPinning ΒΆ
func WithAutoPinning() Option
func WithCookieJar ΒΆ added in v1.8.2
func WithNoAutoDecompress ΒΆ
func WithNoAutoDecompress() Option
func WithNoCookieJar ΒΆ
func WithNoCookieJar() Option
func WithNoFollowRedirects ΒΆ
func WithNoFollowRedirects() Option
func WithPinner ΒΆ added in v1.6.3
func WithQUICConfig ΒΆ added in v1.5.2
func WithTLSConfig ΒΆ added in v1.5.2
func WithTimeout ΒΆ
func WithTracker ΒΆ
func WithTransportOptions ΒΆ
func WithTransportOptions(opts TransportOptions) Option
type Pinner ΒΆ
func (*Pinner) Fingerprint ΒΆ
func (p *Pinner) Fingerprint(cert *x509.Certificate) string
type ProxyError ΒΆ
type ProxyError struct {
Message string
}
func (ProxyError) Error ΒΆ
func (e ProxyError) Error() string
type RoundTripper ΒΆ
func NewRoundTripper ΒΆ
func NewRoundTripper(profile profiles.ClientProfile, dialer proxy.ContextDialer, pinner *Pinner, tracker bandwidth.Tracker, tlsConf *tls.Config, quicConf *quic.Config, opts *TransportOptions) *RoundTripper
func (*RoundTripper) CloseIdleConnections ΒΆ added in v1.5.2
func (rt *RoundTripper) CloseIdleConnections()
Source Files
ΒΆ
Click to show internal directories.
Click to hide internal directories.