proxy

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(opts ...Option) (*http.Client, error)

New creates a new HTTP client with the provided options. It configures the client with optional TLS settings, proxy settings, and custom headers.

Parameters:

opts - A variadic list of Option functions to configure the client.

Returns:

*http.Client - A pointer to the configured HTTP client.
error - An error if the proxy URL is invalid or if there is an issue connecting to the SOCKS5 proxy.

Types

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option is an interface that specifies instrumentation configuration options.

func WithHeaders

func WithHeaders(headers []string) Option

WithHeaders returns a new Option that sets the headers for the http client configuration.

func WithProxyURL

func WithProxyURL(val string) Option

WithProxyURL is a function that returns an Option, which sets the proxyURL field of the config struct.

func WithSkipVerify

func WithSkipVerify(insecure bool) Option

WithSkipVerify returns a new Option that sets the insecure flag for the http client configuration.

func WithSocksURL

func WithSocksURL(val string) Option

WithSocksURL is a function that returns an Option, which sets the socksURL field of the config struct.

func WithTimeout

func WithTimeout(val time.Duration) Option

WithTimeout returns a new Option that sets the timeout for the client configuration. It takes a time.Duration value representing the timeout duration. It returns an optionFunc that sets the timeout field of the configuration to the provided value.

Jump to

Keyboard shortcuts

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