client

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CPool = sync.Pool{
		New: func() interface{} {
			c, err := tlsClient.NewHttpClient(tlsClient.NewNoopLogger(), []tlsClient.HttpClientOption{
				tlsClient.WithTimeoutSeconds(defaultTimeoutSeconds),
				tlsClient.WithClientProfile(profiles.Okhttp4Android13),
			}...)
			if err != nil {
				fhblade.Log.Error("ClientPool error", zap.Error(err))
			}
			proxyUrl := config.V().ProxyUrl
			if proxyUrl != "" {
				c.SetProxy(proxyUrl)
			}
			return c
		},
	}
	CcPool = sync.Pool{
		New: func() interface{} {
			c, err := tlsClient.NewHttpClient(tlsClient.NewNoopLogger(), []tlsClient.HttpClientOption{
				tlsClient.WithTimeoutSeconds(defaultTimeoutSeconds),
				tlsClient.WithCookieJar(tlsClient.NewCookieJar()),
				tlsClient.WithClientProfile(profiles.Okhttp4Android13),
			}...)
			if err != nil {
				fhblade.Log.Error("ClientWithCookiePool error", zap.Error(err))
			}
			proxyUrl := config.V().ProxyUrl
			if proxyUrl != "" {
				c.SetProxy(proxyUrl)
			}
			return c
		},
	}
)

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL