Documentation
¶
Index ¶
- Constants
- func Contains(s []string, e string) bool
- 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(value []string, navigator string, isCipherSuite bool) ([]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 Request
- type Response
- type ServerPush
- type Session
- 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) Close()
- func (s *Session) CloseConns()
- 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) Ip() (ip string, err error)
- func (s *Session) LoadCookie(cookies string) []*http.Cookie
- 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) 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" )
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 : 112
func GetLastIosVersion ¶
func GetLastIosVersion() *tls.ClientHelloSpec
func GetSupportedAlgorithms ¶
func GetSupportedAlgorithms(navigator string) []tls.SignatureScheme
func TurnToUint ¶
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 Request ¶
type Request struct {
HttpRequest *http.Request
Method string
Url string
Body []byte
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
Verify bool
IgnoreBody bool
Proto string
// contains filtered or unexported fields
}
func (*Request) SetContext ¶
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
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
UserAgent, SecChUa string
// 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) CloseConns ¶
func (s *Session) CloseConns()
func (*Session) EnableVerbose ¶
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