proxy

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: MIT Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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