Versions in this module Expand all Collapse all v1 v1.13.2 Jun 17, 2026 v1.1.0 Jun 17, 2026 Changes in this version + const Android + const Authority + const Chrome + const Edge + const Firefox + const Ios + const Method + const Opera + const Path + const Safari + const Scheme + const SchemeHttp + const SchemeHttps + const SchemeWs + const SchemeWss + const SensitiveHeaders + const Socks4 + const Socks4A + const Socks5 + const Socks5H + var ErrTooManyRedirects = errors.New("too many redirects") + var ErrUseLastResponse = errors.New("azuretls: use last response") + func CookiesToString(cookies []*http.Cookie) string + func DecodeResponseBody(body io.ReadCloser, encoding string) ([]byte, error) + func Fingerprint(c *x509.Certificate) string + func GetBrowserClientHelloFunc(browser string) func() *tls.ClientHelloSpec + func GetCookiesMap(cookies []*http.Cookie) map[string]string + func GetLastChromeVersion() *tls.ClientHelloSpec + func GetLastChromeVersionForHTTP3() *tls.ClientHelloSpec + func GetLastFirefoxVersion() *tls.ClientHelloSpec + func GetLastIosVersion() *tls.ClientHelloSpec + func GetLastSafariVersion() *tls.ClientHelloSpec + func RedirectBehavior(reqMethod string, resp *Response, ireq *Request) (redirectMethod string, shouldRedirect, includeBody bool) + func RefererForURL(ireq, newReq *url.URL) string + func ToBytes(b any) []byte + func ToReader(b any) (io.Reader, error) + func UrlEncode(obj any) string + type Context struct + Err error + Request *Request + RequestStartTime time.Time + Response *Response + Session *Session + func (c *Context) Context() context.Context + type ContextKeyHeader struct + type HTTP3Config struct + Enabled bool + ForceHTTP3 bool + type HTTP3Transport struct + func (t *HTTP3Transport) Close() error + func (t *HTTP3Transport) RoundTrip(req *http.Request) (*http.Response, error) + type HeaderOrder []string + type OrderedHeaders [][]string + func (oh *OrderedHeaders) Add(field string, value ...string) + func (oh *OrderedHeaders) Clone() OrderedHeaders + func (oh *OrderedHeaders) Del(field string) OrderedHeaders + func (oh *OrderedHeaders) Get(field string) string + func (oh *OrderedHeaders) Remove(field string) OrderedHeaders + func (oh *OrderedHeaders) Set(field string, value ...string) + func (oh *OrderedHeaders) ToHeader() http.Header + type PHeader []string + func GetDefaultPseudoHeaders() PHeader + type PinHost struct + func (p *PinHost) AddPin(pin string) + func (p *PinHost) AddPins(pin []string) + func (p *PinHost) GetPins() []string + func (p *PinHost) New(addr string, s *Session) (err error) + func (p *PinHost) Verify(c *x509.Certificate) bool + type PinManager struct + var DefaultPinManager *PinManager + func NewPinManager() *PinManager + func (p *PinManager) AddHost(host string, s *Session) error + func (p *PinManager) AddPins(host string, pins []string) + func (p *PinManager) Clear(host string) + func (p *PinManager) GetHost(host string) *PinHost + type ProxyDialer interface + Dial func(userAgent, network, address string) (net.Conn, error) + DialContext func(ctx context.Context, userAgent, network, address string) (net.Conn, error) + type Request struct + Body any + ContentLength int64 + DisableRedirects bool + ForceHTTP1 bool + ForceHTTP3 bool + Header http.Header + HeaderOrder HeaderOrder + HttpRequest *http.Request + IgnoreBody bool + InsecureSkipVerify bool + IsRedirected bool + MaxRedirects uint + Method string + NoCookie bool + OrderedHeaders OrderedHeaders + PHeader PHeader + Proto string + Response *Response + TimeOut time.Duration + Url string + func (r *Request) CloseBody() + func (r *Request) Context() context.Context + func (r *Request) SetContext(ctx context.Context) + func (r *Request) ToDumpString() string + type Response struct + Body []byte + ContentLength int64 + Cookies map[string]string + Header http.Header + HttpResponse *http.Response + IgnoreBody bool + RawBody io.ReadCloser + Request *Request + Session *Session + Status string + StatusCode int + Url string + func (r *Response) CloseBody() error + func (r *Response) JSON(v any) error + func (r *Response) MustJSON(v any) + func (r *Response) ReadBody(in io.ReadCloser, encoding string) (out []byte, err error) + func (r *Response) String() string + func (r *Response) ToDumpString() string + type SOCKS5UDPConn struct + func (c *SOCKS5UDPConn) Close() error + func (c *SOCKS5UDPConn) LocalAddr() net.Addr + func (c *SOCKS5UDPConn) Read(b []byte) (int, error) + func (c *SOCKS5UDPConn) ReadFrom(b []byte) (int, string, error) + func (c *SOCKS5UDPConn) RemoteAddr() net.Addr + func (c *SOCKS5UDPConn) SetDeadline(t time.Time) error + func (c *SOCKS5UDPConn) SetReadDeadline(t time.Time) error + func (c *SOCKS5UDPConn) SetWriteDeadline(t time.Time) error + func (c *SOCKS5UDPConn) Write(b []byte) (int, error) + func (c *SOCKS5UDPConn) WriteTo(b []byte, addr string) (int, error) + type SOCKS5UDPDialer struct + Dialer net.Dialer + Password string + ProxyAddr string + Username string + func NewSOCKS5UDPDialer(proxyAddr, username, password string) *SOCKS5UDPDialer + func (d *SOCKS5UDPDialer) DialUDP(ctx context.Context, network string, remoteAddr string) (*SOCKS5UDPConn, error) + type Session struct + Browser string + Callback func(request *Request, response *Response, err error) + CallbacksWithContext []func(ctx *Context) + CheckRedirect func(req *Request, reqs []*Request) error + CookieJar http.CookieJar + Dial func(ctx context.Context, network, addr string) (net.Conn, error) + DisableAutoDecompression bool + GetClientHelloSpec func() *tls.ClientHelloSpec + GetClientHelloSpecHTTP3 func() *tls.ClientHelloSpec + H2Proxy bool + HTTP2Transport *http2.Transport + HTTP3Config *HTTP3Config + Header http.Header + HeaderOrder HeaderOrder + HeaderPriority *http2.PriorityParam + InsecureSkipVerify bool + MaxRedirects uint + ModifyConfig func(config *tls.Config) error + ModifyDialer func(dialer *net.Dialer) error + OrderedHeaders OrderedHeaders + PHeader PHeader + PinManager *PinManager + PreHook func(request *Request) error + PreHooksWithContext []func(ctx *Context) error + Proxy string + ProxyDialer *proxyDialer + ProxyHeader http.Header + TimeOut time.Duration + Transport *http.Transport + UserAgent string + Verbose bool + VerboseFunc func(request *Request, response *Response, err error) + VerboseIgnoreHost []string + VerbosePath string + VerifyPins bool + func NewSession() *Session + func NewSessionWithContext(ctx context.Context) *Session + func (s *Session) AddPins(u *url.URL, pins []string) error + func (s *Session) ApplyHTTP2(fp string) error + func (s *Session) ApplyHTTP3(fp string) error + func (s *Session) ApplyJa3(ja3, navigator string) error + func (s *Session) ApplyJa3WithSpecifications(ja3 string, specifications *TlsSpecifications, navigator string) error + func (s *Session) ClearPins(u *url.URL) error + func (s *Session) ClearProxy() + func (s *Session) ClearProxyChain() + func (s *Session) Close() + func (s *Session) Connect(u string) error + func (s *Session) Context() context.Context + func (s *Session) Delete(url string, args ...any) (*Response, error) + func (s *Session) DisableDump() + func (s *Session) DisableHTTP3() + func (s *Session) DisableLog() + func (s *Session) Do(request *Request, args ...any) (*Response, error) + func (s *Session) Dump(dir string, uris ...string) error + func (s *Session) DumpAndLog(dir string, uris ...string) error + func (s *Session) DumpIgnore(uri string) bool + func (s *Session) DumpRequestResponsePair(request *Request, response *Response, err error, targetFile string) error + func (s *Session) EnableDump() + func (s *Session) EnableHTTP3() error + func (s *Session) EnableLog() + func (s *Session) EnableVerbose(path string, ignoreHost []string) error + func (s *Session) Get(url string, args ...any) (*Response, error) + func (s *Session) GetBrowserHTTP3ClientHelloFunc(browser string) func() *tls.ClientHelloSpec + func (s *Session) GetProxyChain() []*url.URL + func (s *Session) Head(url string, args ...any) (*Response, error) + func (s *Session) Ip() (ip string, err error) + func (s *Session) IsChainProxy() bool + func (s *Session) Log(uris ...string) + func (s *Session) LogIgnore(uri string) bool + func (s *Session) NewHTTP3Transport() (*HTTP3Transport, error) + func (s *Session) NewWebsocket(url string, readBufferSize, writeBufferSize int, args ...any) (*Websocket, error) + func (s *Session) NewWebsocketWithContext(ctx context.Context, url string, readBufferSize, writeBufferSize int, ...) (*Websocket, error) + func (s *Session) Options(url string, args ...any) (*Response, error) + func (s *Session) Patch(url string, data any, args ...any) (*Response, error) + func (s *Session) Post(url string, data any, args ...any) (*Response, error) + func (s *Session) Put(url string, data any, args ...any) (*Response, error) + func (s *Session) SetContext(ctx context.Context) + func (s *Session) SetProxy(proxy string) error + func (s *Session) SetProxyChain(proxies []string) error + func (s *Session) SetTimeout(timeout time.Duration) + func (s *Session) UseCallbackWithContext(callback func(ctx *Context)) + func (s *Session) UsePrehookWithContext(preHook func(ctx *Context) error) + type TlsSpecifications struct + AlpnProtocols []string + ApplicationSettingsProtocols []string + CertCompressionAlgos []tls.CertCompressionAlgo + DelegatedCredentialsAlgorithmSignatures []tls.SignatureScheme + PSKKeyExchangeModes []uint8 + RecordSizeLimit uint16 + RenegotiationSupport tls.RenegotiationSupport + SignatureAlgorithms []tls.SignatureScheme + SignatureAlgorithmsCert []tls.SignatureScheme + SupportedVersions []uint16 + func DefaultTlsSpecifications(navigator string) *TlsSpecifications + type Websocket struct + Headers http.Header + Request *Request + Response *http.Response + Url string