Documentation ¶
Index ¶
- Variables
- func GetSpecFactoryFromJa3String(ja3String string, ...) (func() (tls.ClientHelloSpec, error), error)
- type BadPinHandlerFunc
- type CertificatePinner
- type ClientProfile
- type ContextKeyHeader
- type CookieJar
- type CookieJarOption
- type HttpClient
- type HttpClientOption
- func WithCatchPanics() HttpClientOption
- func WithCertificatePinning(certificatePins map[string][]string, handlerFunc BadPinHandlerFunc) HttpClientOption
- func WithCharlesProxy(host string, port string) HttpClientOption
- func WithClientProfile(clientProfile ClientProfile) HttpClientOption
- func WithCookieJar(jar http.CookieJar) HttpClientOption
- func WithCustomRedirectFunc(redirectFunc func(req *http.Request, via []*http.Request) error) HttpClientOption
- func WithDebug() HttpClientOption
- func WithDisableIPV6() HttpClientOption
- func WithForceHttp1() HttpClientOption
- func WithInsecureSkipVerify() HttpClientOption
- func WithLocalAddr(localAddr net.TCPAddr) HttpClientOption
- func WithNotFollowRedirects() HttpClientOption
- func WithProxyUrl(proxyUrl string) HttpClientOption
- func WithRandomTLSExtensionOrder() HttpClientOption
- func WithServerNameOverwrite(serverName string) HttpClientOption
- func WithTimeout(timeout int) HttpClientOption
- func WithTimeoutMilliseconds(timeout int) HttpClientOption
- func WithTimeoutSeconds(timeout int) HttpClientOption
- func WithTransportOptions(transportOptions *TransportOptions) HttpClientOption
- type Logger
- type TransportOptions
Constants ¶
This section is empty.
Variables ¶
var Chrome_103 = ClientProfile{ // contains filtered or unexported fields }
var Chrome_104 = ClientProfile{ // contains filtered or unexported fields }
var Chrome_105 = ClientProfile{ // contains filtered or unexported fields }
var Chrome_106 = ClientProfile{ // contains filtered or unexported fields }
var Chrome_107 = ClientProfile{ // contains filtered or unexported fields }
var Chrome_108 = ClientProfile{ // contains filtered or unexported fields }
var Chrome_109 = ClientProfile{ // contains filtered or unexported fields }
var Chrome_110 = ClientProfile{ // contains filtered or unexported fields }
var Chrome_111 = ClientProfile{ // contains filtered or unexported fields }
var Chrome_112 = ClientProfile{ // contains filtered or unexported fields }
var CloudflareCustom = ClientProfile{ // contains filtered or unexported fields }
var ConfirmedAndroid = ClientProfile{ // contains filtered or unexported fields }
var ConfirmedAndroid2 = ClientProfile{ // contains filtered or unexported fields }
var ConfirmedIos = ClientProfile{ // contains filtered or unexported fields }
var DefaultBadPinHandler = func(req *http.Request) { fmt.Println("this is the default bad pin handler") }
var DefaultClientProfile = Chrome_112
var DefaultOptions = []HttpClientOption{ WithTimeoutSeconds(DefaultTimeoutSeconds), WithClientProfile(DefaultClientProfile), WithRandomTLSExtensionOrder(), WithNotFollowRedirects(), }
var DefaultTimeoutSeconds = 30
var ErrBadPinDetected = errors.New("bad ssl pin detected")
var Firefox_102 = ClientProfile{ // contains filtered or unexported fields }
var Firefox_104 = ClientProfile{ // contains filtered or unexported fields }
var Firefox_105 = ClientProfile{ // contains filtered or unexported fields }
var Firefox_106 = ClientProfile{ // contains filtered or unexported fields }
var Firefox_108 = ClientProfile{ // contains filtered or unexported fields }
var Firefox_110 = ClientProfile{ // contains filtered or unexported fields }
var H2SettingsMap = map[string]http2.SettingID{ "HEADER_TABLE_SIZE": http2.SettingHeaderTableSize, "ENABLE_PUSH": http2.SettingEnablePush, "MAX_CONCURRENT_STREAMS": http2.SettingMaxConcurrentStreams, "INITIAL_WINDOW_SIZE": http2.SettingInitialWindowSize, "MAX_FRAME_SIZE": http2.SettingMaxFrameSize, "MAX_HEADER_LIST_SIZE": http2.SettingMaxHeaderListSize, }
var MMSIos = ClientProfile{ // contains filtered or unexported fields }
var MappedTLSClients = map[string]ClientProfile{ "chrome_103": Chrome_103, "chrome_104": Chrome_104, "chrome_105": Chrome_105, "chrome_106": Chrome_106, "chrome_107": Chrome_107, "chrome_108": Chrome_108, "chrome_109": Chrome_109, "chrome_110": Chrome_110, "chrome_111": Chrome_111, "chrome_112": Chrome_112, "safari_15_6_1": Safari_15_6_1, "safari_16_0": Safari_16_0, "safari_ipad_15_6": Safari_Ipad_15_6, "safari_ios_15_5": Safari_IOS_15_5, "safari_ios_15_6": Safari_IOS_15_6, "safari_ios_16_0": Safari_IOS_16_0, "firefox_102": Firefox_102, "firefox_104": Firefox_104, "firefox_105": Firefox_105, "firefox_106": Firefox_106, "firefox_108": Firefox_108, "firefox_110": Firefox_110, "opera_89": Opera_89, "opera_90": Opera_90, "opera_91": Opera_91, "zalando_android_mobile": ZalandoAndroidMobile, "zalando_ios_mobile": ZalandoIosMobile, "nike_ios_mobile": NikeIosMobile, "nike_android_mobile": NikeAndroidMobile, "cloudscraper": CloudflareCustom, "mms_ios": MMSIos, "mesh_ios": MeshIos, "mesh_ios_1": MeshIos, "mesh_ios_2": MeshIos2, "mesh_android": MeshAndroid, "mesh_android_1": MeshAndroid, "mesh_android_2": MeshAndroid2, "confirmed_ios": ConfirmedIos, "confirmed_android": ConfirmedAndroid, "okhttp4_android_7": Okhttp4Android7, "okhttp4_android_8": Okhttp4Android8, "okhttp4_android_9": Okhttp4Android9, "okhttp4_android_10": Okhttp4Android10, "okhttp4_android_11": Okhttp4Android11, "okhttp4_android_12": Okhttp4Android12, "okhttp4_android_13": Okhttp4Android13, }
var MeshAndroid = ClientProfile{ // contains filtered or unexported fields }
var MeshAndroid2 = ClientProfile{ // contains filtered or unexported fields }
var MeshIos = ClientProfile{ // contains filtered or unexported fields }
var MeshIos2 = ClientProfile{ // contains filtered or unexported fields }
var NikeAndroidMobile = ClientProfile{ // contains filtered or unexported fields }
var NikeIosMobile = ClientProfile{ // contains filtered or unexported fields }
var Okhttp4Android10 = ClientProfile{ // contains filtered or unexported fields }
var Okhttp4Android11 = ClientProfile{ // contains filtered or unexported fields }
var Okhttp4Android12 = ClientProfile{ // contains filtered or unexported fields }
var Okhttp4Android13 = ClientProfile{ // contains filtered or unexported fields }
var Okhttp4Android7 = ClientProfile{ // contains filtered or unexported fields }
var Okhttp4Android8 = ClientProfile{ // contains filtered or unexported fields }
var Okhttp4Android9 = ClientProfile{ // contains filtered or unexported fields }
var Opera_89 = ClientProfile{ // contains filtered or unexported fields }
var Opera_90 = ClientProfile{ // contains filtered or unexported fields }
var Opera_91 = ClientProfile{ // contains filtered or unexported fields }
var Safari_15_6_1 = ClientProfile{ // contains filtered or unexported fields }
var Safari_16_0 = ClientProfile{ // contains filtered or unexported fields }
var Safari_IOS_15_5 = ClientProfile{ // contains filtered or unexported fields }
var Safari_IOS_15_6 = ClientProfile{ // contains filtered or unexported fields }
var Safari_IOS_16_0 = ClientProfile{ // contains filtered or unexported fields }
var Safari_Ipad_15_6 = ClientProfile{ // contains filtered or unexported fields }
var ZalandoAndroidMobile = ClientProfile{ // contains filtered or unexported fields }
var ZalandoIosMobile = ClientProfile{ // contains filtered or unexported fields }
Functions ¶
Types ¶
type BadPinHandlerFunc ¶
type CertificatePinner ¶
func NewCertificatePinner ¶
func NewCertificatePinner(certificatePins map[string][]string) (CertificatePinner, error)
type ClientProfile ¶
type ClientProfile struct {
// contains filtered or unexported fields
}
func NewClientProfile ¶
func NewClientProfile(clientHelloId tls.ClientHelloID, settings map[http2.SettingID]uint32, settingsOrder []http2.SettingID, pseudoHeaderOrder []string, connectionFlow uint32, priorities []http2.Priority, headerPriority *http2.PriorityParam) ClientProfile
func (ClientProfile) GetClientHelloSpec ¶
func (c ClientProfile) GetClientHelloSpec() (tls.ClientHelloSpec, error)
func (ClientProfile) GetClientHelloStr ¶
func (c ClientProfile) GetClientHelloStr() string
type ContextKeyHeader ¶
type ContextKeyHeader struct{}
Users of context.WithValue should define their own types for keys
type CookieJar ¶
func NewCookieJar ¶
func NewCookieJar(options ...CookieJarOption) CookieJar
type CookieJarOption ¶
type CookieJarOption func(config *cookieJarConfig)
func WithAllowEmptyCookies ¶
func WithAllowEmptyCookies() CookieJarOption
func WithDebugLogger ¶
func WithDebugLogger() CookieJarOption
func WithLogger ¶
func WithLogger(logger Logger) CookieJarOption
func WithSkipExisting ¶
func WithSkipExisting() CookieJarOption
type HttpClient ¶
type HttpClient interface { GetCookies(u *url.URL) []*http.Cookie SetCookies(u *url.URL, cookies []*http.Cookie) SetCookieJar(jar http.CookieJar) GetCookieJar() http.CookieJar SetProxy(proxyUrl string) error GetProxy() string SetFollowRedirect(followRedirect bool) GetFollowRedirect() bool CloseIdleConnections() Do(req *http.Request) (*http.Response, *harlog.HARContainer, error) Get(url string) (resp *http.Response, hr *harlog.HARContainer, err error) Head(url string) (resp *http.Response, hr *harlog.HARContainer, err error) Post(url, contentType string, body io.Reader) (resp *http.Response, hr *harlog.HARContainer, err error) }
func NewHttpClient ¶
func NewHttpClient(logger Logger, options ...HttpClientOption) (HttpClient, error)
NewHttpClient constructs a new HTTP client with the given logger and client options.
func ProvideDefaultClient ¶
func ProvideDefaultClient(logger Logger) (HttpClient, error)
type HttpClientOption ¶
type HttpClientOption func(config *httpClientConfig)
func WithCatchPanics ¶
func WithCatchPanics() HttpClientOption
WithCatchPanics configures a client to catch all go panics happening during a request and not print the stacktrace.
func WithCertificatePinning ¶
func WithCertificatePinning(certificatePins map[string][]string, handlerFunc BadPinHandlerFunc) HttpClientOption
WithCertificatePinning enables SSL Pinning for the client and will throw an error if the SSL Pin is not matched. Please refer to https://github.com/tam7t/hpkp/#examples in order to see how to generate pins. The certificatePins are a map with the host as key. You can provide a BadPinHandlerFunc or nil as second argument. This function will be executed once a bad ssl pin is detected. BadPinHandlerFunc has to be defined like this: func(req *http.Request){}
func WithCharlesProxy ¶
func WithCharlesProxy(host string, port string) HttpClientOption
WithCharlesProxy configures the HTTP client to use a local running charles as proxy.
host and port can be empty, then default 127.0.0.1 and port 8888 will be used
func WithClientProfile ¶
func WithClientProfile(clientProfile ClientProfile) HttpClientOption
WithClientProfile configures a TLS client to use the specified client profile.
func WithCookieJar ¶
func WithCookieJar(jar http.CookieJar) HttpClientOption
WithCookieJar configures a HTTP client to use the specified cookie jar.
func WithCustomRedirectFunc ¶
func WithCustomRedirectFunc(redirectFunc func(req *http.Request, via []*http.Request) error) HttpClientOption
WithCustomRedirectFunc configures an HTTP client to use a custom redirect func. The redirect func have to look like that: func(req *http.Request, via []*http.Request) error Please only provide a custom redirect function if you know what you are doing. Check docs on net/http.Client CheckRedirect
func WithDebug ¶
func WithDebug() HttpClientOption
WithDebug configures a client to log debugging information.
func WithDisableIPV6 ¶
func WithDisableIPV6() HttpClientOption
WithDisableIPV6 configures a dialer to use tcp4 network argument
func WithForceHttp1 ¶
func WithForceHttp1() HttpClientOption
WithForceHttp1 configures a client to force HTTP/1.1 as the used protocol.
func WithInsecureSkipVerify ¶
func WithInsecureSkipVerify() HttpClientOption
WithInsecureSkipVerify configures a client to skip SSL certificate verification.
func WithLocalAddr ¶
func WithLocalAddr(localAddr net.TCPAddr) HttpClientOption
WithLocalAddr configures an HTTP client to use the specified local address.
func WithNotFollowRedirects ¶
func WithNotFollowRedirects() HttpClientOption
WithNotFollowRedirects configures an HTTP client to not follow HTTP redirects.
func WithProxyUrl ¶
func WithProxyUrl(proxyUrl string) HttpClientOption
WithProxyUrl configures a HTTP client to use the specified proxy URL.
proxyUrl should be formatted as:
"http://user:pass@host:port"
func WithRandomTLSExtensionOrder ¶
func WithRandomTLSExtensionOrder() HttpClientOption
WithRandomTLSExtensionOrder configures a TLS client to randomize the order of TLS extensions being sent in the ClientHello.
Placement of GREASE and padding is fixed and will not be affected by this.
func WithServerNameOverwrite ¶
func WithServerNameOverwrite(serverName string) HttpClientOption
WithServerNameOverwrite configures a TLS client to overwrite the server name being used for certificate verification and in the client hello. This option does only work properly if WithInsecureSkipVerify is set to true in addition
func WithTimeout ¶
func WithTimeout(timeout int) HttpClientOption
WithTimeout configures an HTTP client to use the specified request timeout.
timeout is the request timeout in seconds. Deprecated: use either WithTimeoutSeconds or WithTimeoutMilliseconds
func WithTimeoutMilliseconds ¶
func WithTimeoutMilliseconds(timeout int) HttpClientOption
WithTimeoutMilliseconds configures an HTTP client to use the specified request timeout.
timeout is the request timeout in milliseconds.
func WithTimeoutSeconds ¶
func WithTimeoutSeconds(timeout int) HttpClientOption
WithTimeoutSeconds configures an HTTP client to use the specified request timeout.
timeout is the request timeout in seconds.
func WithTransportOptions ¶
func WithTransportOptions(transportOptions *TransportOptions) HttpClientOption
WithTransportOptions configures a client to use the specified transport options.
type Logger ¶
type Logger interface { Debug(format string, args ...any) Info(format string, args ...any) Warn(format string, args ...any) Error(format string, args ...any) }
func NewDebugLogger ¶
func NewNoopLogger ¶
func NewNoopLogger() Logger
type TransportOptions ¶
type TransportOptions struct { DisableKeepAlives bool DisableCompression bool MaxIdleConns int MaxIdleConnsPerHost int MaxConnsPerHost int MaxResponseHeaderBytes int64 // Zero means to use a default limit. WriteBufferSize int // If zero, a default (currently 4KB) is used. ReadBufferSize int // If zero, a default (currently 4KB) is used. // IdleConnTimeout is the maximum amount of time an idle (keep-alive) // connection will remain idle before closing itself. Zero means no limit. IdleConnTimeout *time.Duration // RootCAs is the set of root certificate authorities used to verify // the remote server's certificate. RootCAs *x509.CertPool }
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
tls_client_cffi_src provides and manages a CFFI (C Foreign Function Interface) which allows code in other languages to interact with the module.
|
tls_client_cffi_src provides and manages a CFFI (C Foreign Function Interface) which allows code in other languages to interact with the module. |