Documentation
¶
Overview ¶
Package httpclient provides a centralized HTTP client configuration for pipeleek. It offers a retryable HTTP client with cookie support, custom headers, proxy configuration, TLS settings, and SOCKS proxy support.
Index ¶
- func GetPipeleekHTTPClient(cookieUrl string, cookies []*http.Cookie, defaultHeaders map[string]string) *resty.Client
- func GetPipeleekStandardHTTPClient() *http.Client
- func GetPipeleekTransport() *http.Transport
- func SetHTTPTimeout(d time.Duration)
- func SetIgnoreProxy(ignore bool)
- func SetInsecureSkipVerify(skip bool)
- func SetProxy(proxyURL string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPipeleekHTTPClient ¶
func GetPipeleekHTTPClient(cookieUrl string, cookies []*http.Cookie, defaultHeaders map[string]string) *resty.Client
GetPipeleekHTTPClient creates a Resty HTTP client applying the global TLS, proxy, retry, and timeout settings.
func GetPipeleekStandardHTTPClient ¶ added in v0.66.0
GetPipeleekStandardHTTPClient creates a standard-library HTTP client with Pipeleek's transport settings.
func GetPipeleekTransport ¶ added in v0.66.0
GetPipeleekTransport returns a configured *http.Transport using the current global client options (TLS, proxy, SOCKS). Use this to inject Pipeleek's transport settings into third-party HTTP client libraries (e.g. Resty, go-github) that manage their own request lifecycle but should still share the same network configuration.
func SetHTTPTimeout ¶ added in v0.66.0
SetHTTPTimeout sets the per-request timeout applied to all Pipeleek-managed HTTP clients. A zero value (the default) means no timeout.
func SetIgnoreProxy ¶ added in v0.48.0
func SetIgnoreProxy(ignore bool)
func SetInsecureSkipVerify ¶ added in v0.66.0
func SetInsecureSkipVerify(skip bool)
SetInsecureSkipVerify controls TLS certificate verification for all Pipeleek-managed HTTP clients. Defaults to true (skip verification) to support self-hosted targets with self-signed certificates. Set to false to enforce certificate validation.
func SetProxy ¶ added in v0.66.0
func SetProxy(proxyURL string)
SetProxy sets a proxy URL for all Pipeleek-managed HTTP clients. Accepts both HTTP ("http://host:port") and SOCKS5 ("socks5://host:port") URLs. When non-empty, it takes precedence over the HTTP_PROXY environment variable.
Types ¶
This section is empty.