proxy

package
v0.0.0-...-95d5754 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// HTTP Status Codes
	StatusProxyAuthRequired = 407
	StatusBadGateway        = 502
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CertStorage

type CertStorage struct {
	// contains filtered or unexported fields
}

func NewCertStorage

func NewCertStorage() *CertStorage

func (*CertStorage) Fetch

func (cs *CertStorage) Fetch(hostname string, gen func() (*tls.Certificate, error)) (*tls.Certificate, error)

type Proxy

type Proxy struct {
	sync.RWMutex
	Scheme              string
	Host                string
	Url                 *url.URL
	Transport           *http.Transport
	Username            string
	Password            string
	LatestUsageStatus   string
	LatestUsageAt       string
	LatestUsageDuration string
	AvgUsageDuration    string
	UsageCount          int
}

type ProxyChecker

type ProxyChecker struct {
	// contains filtered or unexported fields
}

func NewProxyChecker

func NewProxyChecker(cfg *config.Config, proxyServer *ProxyServer) *ProxyChecker

func (*ProxyChecker) Check

func (pl *ProxyChecker) Check() error

type ProxyHistory

type ProxyHistory struct {
	Scheme     string `json:"scheme"`
	Host       string `json:"host"`
	Status     string `json:"status"`
	Duration   string `json:"duration"`
	RequestUrl string `json:"request_url"`
	UsedAt     string `json:"used_at"`
}

type ProxyLoader

type ProxyLoader struct {
	// contains filtered or unexported fields
}

func NewProxyLoader

func NewProxyLoader(cfg *config.Config, proxyServer *ProxyServer) *ProxyLoader

func (*ProxyLoader) CreateProxy

func (pl *ProxyLoader) CreateProxy(proxyURL string) (*Proxy, error)

func (*ProxyLoader) Load

func (pl *ProxyLoader) Load() error

func (*ProxyLoader) Reload

func (pl *ProxyLoader) Reload() error

type ProxyServer

type ProxyServer struct {
	sync.RWMutex

	Proxies      []*Proxy
	ProxyHistory []ProxyHistory
	// contains filtered or unexported fields
}

func NewProxyServer

func NewProxyServer(cfg *config.Config) *ProxyServer

func (*ProxyServer) AddProxy

func (ps *ProxyServer) AddProxy(proxy *Proxy)

func (*ProxyServer) Listen

func (ps *ProxyServer) Listen()

Jump to

Keyboard shortcuts

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