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) Head(url string) (*http.Response, error)
- 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) 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 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) 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 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.