proxy

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateHTTPClient

func CreateHTTPClient(proxyConfig *Config, timeout time.Duration) (*http.Client, error)

CreateHTTPClient creates an HTTP client with proxy configuration

func ValidateProxy

func ValidateProxy(client *http.Client, testURL string) error

ValidateProxy tests if the proxy is working

Types

type Config

type Config struct {
	URL      string   // Proxy URL (http://proxy.example.com:8080)
	NoProxy  []string // List of hosts to bypass proxy
	Username string   // Proxy username (optional)
	Password string   // Proxy password (optional)
}

Config represents proxy configuration

func GetProxyFromEnvironment

func GetProxyFromEnvironment() *Config

GetProxyFromEnvironment gets proxy configuration from environment variables

func NewConfig

func NewConfig(proxyURL string) (*Config, error)

NewConfig creates a new proxy configuration

Jump to

Keyboard shortcuts

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