dialer

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServerSelectionFirst
	ServerSelectionRandom
	ServerSelectionFastest
)
View Source
const (
	PROXY_CONNECT_METHOD       = "CONNECT"
	PROXY_HOST_HEADER          = "Host"
	PROXY_AUTHORIZATION_HEADER = "Proxy-Authorization"
)

Variables

This section is empty.

Functions

func BasicAuthHeader

func BasicAuthHeader(login, password string) string

func WrapStringToCb

func WrapStringToCb(s string) func() (string, error)

Types

type ContextDialer

type ContextDialer interface {
	Dialer
	DialContext(ctx context.Context, network, address string) (net.Conn, error)
}

func SelectFirst

func SelectFirst(_ context.Context, dialers []ContextDialer) (ContextDialer, error)

func SelectRandom

func SelectRandom(_ context.Context, dialers []ContextDialer) (ContextDialer, error)

type Dialer

type Dialer interface {
	Dial(network, address string) (net.Conn, error)
}

type FixedDialer

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

func NewFixedDialer

func NewFixedDialer(address string, next ContextDialer) *FixedDialer

func (*FixedDialer) Dial

func (d *FixedDialer) Dial(network, address string) (net.Conn, error)

func (*FixedDialer) DialContext

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

type LookupNetIPer

type LookupNetIPer interface {
	LookupNetIP(context.Context, string, string) ([]netip.Addr, error)
}

type ProxyDialer

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

func NewProxyDialer

func NewProxyDialer(address, tlsServerName, fakeSNI, auth stringCb, caPool *x509.CertPool, nextDialer ContextDialer) *ProxyDialer

func ProxyDialerFromURL

func ProxyDialerFromURL(u *url.URL, next ContextDialer) (*ProxyDialer, error)

func (*ProxyDialer) Address

func (d *ProxyDialer) Address() (string, error)

func (*ProxyDialer) Dial

func (d *ProxyDialer) Dial(network, address string) (net.Conn, error)

func (*ProxyDialer) DialContext

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

type ResolvingDialer

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

func NewResolvingDialer

func NewResolvingDialer(lookup LookupNetIPer, next ContextDialer) *ResolvingDialer

func (*ResolvingDialer) Dial

func (d *ResolvingDialer) Dial(network, address string) (net.Conn, error)

func (*ResolvingDialer) DialContext

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

type SelectionFunc

type SelectionFunc = func(ctx context.Context, dialers []ContextDialer) (ContextDialer, error)

func NewFastestServerSelectionFunc

func NewFastestServerSelectionFunc(url string, dlLimit int64, tlsClientConfig *tls.Config) SelectionFunc

type ServerSelection

type ServerSelection int

func ParseServerSelection

func ParseServerSelection(s string) (ServerSelection, error)

func (ServerSelection) String

func (ss ServerSelection) String() string

Jump to

Keyboard shortcuts

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