Documentation
¶
Index ¶
- Constants
- func DecompressBody(Body []byte, encoding string) (parsedBody []byte)
- func DeflateData(data []byte) (resData []byte, err error)
- func EnflateData(data []byte) (resData []byte, err error)
- func GUnzipData(data []byte) (resData []byte, err error)
- func GetExtensions(extensions []string, specifications *TlsSpecifications, ...) ([]tls.TLSExtension, uint16, uint16, error)
- func GetLastChromeVersion() *tls.ClientHelloSpec
- func GetLastIosVersion() *tls.ClientHelloSpec
- func GetSupportedAlgorithms(navigator string) []tls.SignatureScheme
- func GetSupportedVersion(navigator string) ([]uint16, uint16, uint16)
- func TurnToUint(ciphers []string, navigator string) ([]uint16, string)
- func UnBrotliData(data []byte) (resData []byte, err error)
- type ContextKeyHeader
- type DefaultPushHandler
- type HeaderOrder
- type OrderedHeaders
- 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)
- type PHeader
- type PinManager
- type Request
- type RequestConn
- type RequestConnPool
- type Response
- type ServerPush
- type Session
- func (s *Session) AddPins(u *url.URL, pins []string) error
- func (s *Session) ApplyHTTP2(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) Close()
- func (s *Session) Delete(url string, args ...any) (*Response, error)
- func (s *Session) Do(request *Request, args ...any) (*Response, error)
- func (s *Session) EnableVerbose(path string, ignoreHost []string)
- func (s *Session) Get(url string, args ...any) (*Response, error)
- func (s *Session) GetCookies(u string) map[string]string
- func (s *Session) Head(url string, args ...any) (*Response, error)
- func (s *Session) Ip() (ip string, err error)
- func (s *Session) LoadCookie(cookies string) []*http.Cookie
- 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 []byte, args ...any) (*Response, error)
- func (s *Session) Put(url string, data []byte, args ...any) (*Response, error)
- func (s *Session) SetContext(ctx context.Context)
- func (s *Session) SetProxy(proxy string)
- func (s *Session) SetTimeout(timeout time.Duration)
- type TlsSpecifications
- type TlsVersion
Constants ¶
const ( Chrome = "chrome" Firefox = "firefox" Opera = "opera" Safari = "safari" Edge = "edge" Ios = "ios" Android = "android" //deprecated )
const ( Path = ":path" Method = ":method" Authority = ":authority" Scheme = ":scheme" )
const ( SchemeHttp = "http" SchemeHttps = "https" SchemeWs = "ws" SchemeWss = "wss" )
Variables ¶
This section is empty.
Functions ¶
func DecompressBody ¶
DecompressBody unzips compressed data
func DeflateData ¶
func EnflateData ¶
func GUnzipData ¶
func GetExtensions ¶
func GetExtensions(extensions []string, specifications *TlsSpecifications, defaultPointsFormat []string, defaultCurves []string, navigator string) ([]tls.TLSExtension, uint16, uint16, error)
func GetLastChromeVersion ¶
func GetLastChromeVersion() *tls.ClientHelloSpec
GetLastChromeVersion apply the latest Chrome version Current Chrome version : 114
func GetLastIosVersion ¶
func GetLastIosVersion() *tls.ClientHelloSpec
func GetSupportedAlgorithms ¶
func GetSupportedAlgorithms(navigator string) []tls.SignatureScheme
func UnBrotliData ¶
Types ¶
type ContextKeyHeader ¶
type ContextKeyHeader struct{}
type DefaultPushHandler ¶
type DefaultPushHandler struct {
// contains filtered or unexported fields
}
DefaultPushHandler default push handler
func (*DefaultPushHandler) HandlePush ¶
func (ph *DefaultPushHandler) HandlePush(r *http2.PushedRequest)
type HeaderOrder ¶
type HeaderOrder []string
type OrderedHeaders ¶
type OrderedHeaders [][]string
OrderedHeaders is a slice of headers.
func (*OrderedHeaders) Add ¶
func (oh *OrderedHeaders) Add(field string, value ...string)
Add adds the value to the field. It appends to any existing values associated with the field.
func (*OrderedHeaders) Clone ¶
func (oh *OrderedHeaders) Clone() OrderedHeaders
Clone returns a copy of the header.
func (*OrderedHeaders) Del ¶
func (oh *OrderedHeaders) Del(field string) OrderedHeaders
Del removes the first instance of the field from the header. If the field is not present, it does nothing.
func (*OrderedHeaders) Get ¶
func (oh *OrderedHeaders) Get(field string) string
Get returns the first value associated with the given field. If the field is not present, it returns an empty string.
func (*OrderedHeaders) Remove ¶
func (oh *OrderedHeaders) Remove(field string) OrderedHeaders
Remove removes the first instance of the field from the header. If the field is not present, it does nothing. Deprecated: Use Del instead.
func (*OrderedHeaders) Set ¶
func (oh *OrderedHeaders) Set(field string, value ...string)
Set sets the field to the given value. It replaces any existing values associated with the field.
type PinManager ¶ added in v1.1.0
type PinManager struct {
// contains filtered or unexported fields
}
func NewPinManager ¶ added in v1.1.0
func NewPinManager() *PinManager
func (*PinManager) AddPin ¶ added in v1.1.0
func (p *PinManager) AddPin(pin string)
func (*PinManager) New ¶ added in v1.1.0
func (p *PinManager) New(addr string) (err error)
func (*PinManager) Verify ¶ added in v1.1.0
func (p *PinManager) Verify(c *x509.Certificate) bool
type Request ¶
type Request struct {
HttpRequest *http.Request
Method string
Url string
Body any
PHeader PHeader
Header http.Header //deprecated, use OrderedHeaders instead
HeaderOrder HeaderOrder //deprecated, use OrderedHeaders instead
OrderedHeaders OrderedHeaders
Proxy string
Browser string
DisableRedirects bool
NoCookie bool
TimeOut time.Duration
IsRedirected bool
FetchServerPush bool
InsecureSkipVerify bool
IgnoreBody bool
Proto string
// contains filtered or unexported fields
}
func (*Request) SetContext ¶
type RequestConn ¶ added in v1.1.0
type RequestConn struct {
TLS *tls.UConn
HTTP2 *http2.ClientConn
Conn net.Conn
Pins *PinManager
// contains filtered or unexported fields
}
func NewRequestConn ¶ added in v1.1.0
func NewRequestConn() *RequestConn
func (*RequestConn) Close ¶ added in v1.1.0
func (rc *RequestConn) Close()
func (*RequestConn) NewConn ¶ added in v1.1.0
func (rc *RequestConn) NewConn(req *Request, doPins bool, getSpec func() *tls.ClientHelloSpec) (err error)
type RequestConnPool ¶ added in v1.1.0
type RequestConnPool struct {
// contains filtered or unexported fields
}
func NewRequestConnPool ¶ added in v1.1.0
func NewRequestConnPool() *RequestConnPool
func (*RequestConnPool) Close ¶ added in v1.1.0
func (p *RequestConnPool) Close()
func (*RequestConnPool) Get ¶ added in v1.1.0
func (p *RequestConnPool) Get(u *url.URL) (c *RequestConn, err error)
func (*RequestConnPool) Remove ¶ added in v1.1.0
func (p *RequestConnPool) Remove(u *url.URL)
func (*RequestConnPool) Set ¶ added in v1.1.0
func (p *RequestConnPool) Set(u *url.URL, c *RequestConn)
type Response ¶
type ServerPush ¶
type Session ¶
type Session struct {
Headers http.Header //deprecated, use OrderedHeaders instead
HeadersOrder HeaderOrder //deprecated
PHeader PHeader
OrderedHeaders OrderedHeaders
CookieJar *cookiejar.Jar
Browser string
Connections *RequestConnPool
GetClientHelloSpec func() *tls.ClientHelloSpec
Proxy string
RotateProxy bool
Verbose bool
VerbosePath string
VerboseIgnoreHost []string
VerboseFunc func(request *Request, response *Response, err error)
TimeOut time.Duration
PreHook func(request *Request) error
Callback func(request *Request, response *Response, err error)
VerifyPins bool // deprecated, this parameter is ignored as verify pins is always true. To disable pin verification, use the InsecureSkipVerify parameter instead
InsecureSkipVerify bool
UserAgent, SecChUa string
ServerPush chan *Response
// contains filtered or unexported fields
}
func NewSession ¶
func NewSession() *Session
NewSession creates a new session It is recommended to use this function to create a new session instead of creating a new Session struct This function will set the default values for the session
func NewSessionWithContext ¶
func (*Session) ApplyHTTP2 ¶
func (*Session) ApplyJa3WithSpecifications ¶
func (s *Session) ApplyJa3WithSpecifications(ja3 string, specifications TlsSpecifications, navigator string) error
func (*Session) EnableVerbose ¶
func (*Session) SetContext ¶ added in v1.1.0
func (*Session) SetTimeout ¶
type TlsSpecifications ¶
type TlsSpecifications struct {
AlpnProtocols []string
SignatureAlgorithms []tls.SignatureScheme
SupportedVersions []uint16
CertCompressionAlgos []tls.CertCompressionAlgo
DelegatedCredentialsAlgorithmSignatures []tls.SignatureScheme
PSKKeyExchangeModes []uint8
SignatureAlgorithmsCert []tls.SignatureScheme
ApplicationSettingsProtocols []string
RenegotiationSupport tls.RenegotiationSupport
}
func DefaultTlsSpecifications ¶
func DefaultTlsSpecifications() TlsSpecifications
type TlsVersion ¶
type TlsVersion uint16