dialer

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2026 License: MIT Imports: 19 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"
	MISSING_CHAIN_CERT         = `` /* 1387-byte string literal not displayed */

)

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 added in v1.11.0

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

func SelectRandom added in v1.11.0

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, intermediateWorkaround bool, caPool *x509.CertPool, nextDialer ContextDialer) *ProxyDialer

func ProxyDialerFromURL

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

func (*ProxyDialer) Address added in v1.11.0

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 added in v1.11.0

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

func NewFastestServerSelectionFunc added in v1.11.0

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

type ServerSelection added in v1.11.0

type ServerSelection int

func ParseServerSelection added in v1.11.0

func ParseServerSelection(s string) (ServerSelection, error)

func (ServerSelection) String added in v1.11.0

func (ss ServerSelection) String() string

Jump to

Keyboard shortcuts

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