proxy

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Proxy

type Proxy struct {
	Host     string
	Port     int
	Type     Type
	Username string
	Password string
}

func (*Proxy) String

func (p *Proxy) String() string

func (*Proxy) URL

func (p *Proxy) URL() *url.URL

type ProxyWithStats

type ProxyWithStats struct {
	Proxy *Proxy
	Stats *Stats
}

func NewProxyWithStats

func NewProxyWithStats(proxy *Proxy) *ProxyWithStats

func (*ProxyWithStats) RecordFailure

func (p *ProxyWithStats) RecordFailure()

func (*ProxyWithStats) RecordSuccess

func (p *ProxyWithStats) RecordSuccess()

type Stats

type Stats struct {
	TotalRequests   int
	SuccessRequests int
	FailedRequests  int
	LastUsed        time.Time
	FirstUsed       time.Time
}

func (*Stats) FailureRate

func (s *Stats) FailureRate() float64

func (*Stats) IsBad

func (s *Stats) IsBad(minRequests int) bool

func (*Stats) SuccessRate

func (s *Stats) SuccessRate() float64

type Type

type Type int
const (
	HTTP Type = iota
	SOCKS4
	SOCKS5
)

Jump to

Keyboard shortcuts

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