proxy

package
v0.0.0-...-685ccc0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2025 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadPicker

func LoadPicker(p ChainPicker, r io.Reader) error

Types

type Chain

type Chain []ProxyInfo

func (Chain) ToDialer

func (c Chain) ToDialer() (*Dialer, error)

type ChainPicker

type ChainPicker interface {
	Add(Chain)
	Next() Chain
	All() []Chain
	Len() int
}

type Dialer

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

func New

func New(proxies ...ProxyDialer) *Dialer

func (*Dialer) DialContext

func (d *Dialer) DialContext(ctx context.Context, network, address string) (net.Conn, error)

func (*Dialer) String

func (d *Dialer) String() string

type ProxyDialer

type ProxyDialer interface {
	net.Addr
	Protocol() string
	KWArgs() map[string]string
	DialContextWithConn(ctx context.Context, conn net.Conn, network, address string) (net.Conn, error)
}

type ProxyInfo

type ProxyInfo struct {
	Protocol string
	Address  string
	Args     []string
	KWArgs   map[string]string
}

func (*ProxyInfo) String

func (p *ProxyInfo) String() string

func (*ProxyInfo) ToDialer

func (p *ProxyInfo) ToDialer() (ProxyDialer, error)

func (*ProxyInfo) ToSOCKS4

func (p *ProxyInfo) ToSOCKS4() (ProxyDialer, error)

func (*ProxyInfo) ToSOCKS5

func (p *ProxyInfo) ToSOCKS5() (ProxyDialer, error)

func (*ProxyInfo) ToShadowSocks

func (p *ProxyInfo) ToShadowSocks() (ProxyDialer, error)

type Random

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

func (*Random) Add

func (r *Random) Add(c Chain)

func (*Random) All

func (r *Random) All() []Chain

func (*Random) Len

func (r *Random) Len() int

func (*Random) Next

func (r *Random) Next() Chain

type RoundRobin

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

func (*RoundRobin) Add

func (r *RoundRobin) Add(c Chain)

func (*RoundRobin) All

func (r *RoundRobin) All() []Chain

func (*RoundRobin) Len

func (r *RoundRobin) Len() int

func (*RoundRobin) Next

func (r *RoundRobin) Next() Chain

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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