dialer

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoSuitableAddress  = errors.New("no suitable address")
	ErrBadIPAddressLength = errors.New("bad IP address length")
	ErrUnknownNetwork     = errors.New("unknown network")
)

Functions

func HTTPProxyDialerFromURL

func HTTPProxyDialerFromURL(u *url.URL, next xproxy.Dialer) (xproxy.Dialer, error)

func WantsHostname added in v1.16.0

func WantsHostname(ctx context.Context, net, address string, d Dialer) bool

Types

type BoundDialer

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

func NewBoundDialer

func NewBoundDialer(defaultDialer Dialer, defaultHints string) *BoundDialer

func (*BoundDialer) Dial

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

func (*BoundDialer) DialContext

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

func (*BoundDialer) WantsHostname added in v1.16.0

func (d *BoundDialer) WantsHostname(ctx context.Context, net, address string) bool

type Dialer

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

func AlwaysRequireHostname added in v1.16.0

func AlwaysRequireHostname(d Dialer) Dialer

func MaybeWrapWithContextDialer

func MaybeWrapWithContextDialer(d LegacyDialer) Dialer

func ProxyDialerFromURL

func ProxyDialerFromURL(proxyURL string, forward Dialer) (Dialer, error)

type FilterDialer added in v1.16.0

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

func NewFilterDialer added in v1.16.0

func NewFilterDialer(filterFunc FilterFunc, next Dialer) FilterDialer

func (FilterDialer) Dial added in v1.16.0

func (f FilterDialer) Dial(network, address string) (net.Conn, error)

func (FilterDialer) DialContext added in v1.16.0

func (f FilterDialer) DialContext(ctx context.Context, network, address string) (net.Conn, error)

func (FilterDialer) WantsHostname added in v1.16.0

func (f FilterDialer) WantsHostname(ctx context.Context, network, address string) bool

type FilterFunc added in v1.16.0

type FilterFunc = func(ctx context.Context, req *http.Request, username, network, address string) error

type HTTPProxyDialer

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

func NewHTTPProxyDialer

func NewHTTPProxyDialer(address string, tls bool, userinfo *url.Userinfo, next LegacyDialer) *HTTPProxyDialer

func (*HTTPProxyDialer) Dial

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

func (*HTTPProxyDialer) DialContext

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

type HostnameWanter added in v1.16.0

type HostnameWanter interface {
	WantsHostname(ctx context.Context, net, address string) bool
}

type JSRouter added in v1.17.0

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

func NewJSRouter added in v1.17.0

func NewJSRouter(filename string, instances int, factory func(string) (Dialer, error), logger *clog.CondLogger, next Dialer) (*JSRouter, error)

func (*JSRouter) Dial added in v1.17.0

func (j *JSRouter) Dial(network, address string) (net.Conn, error)

func (*JSRouter) DialContext added in v1.17.0

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

func (*JSRouter) WantsHostname added in v1.17.0

func (j *JSRouter) WantsHostname(ctx context.Context, network, address string) bool

type JSRouterFunc added in v1.17.0

type JSRouterFunc = func(req *jsext.JSRequestInfo, dst *jsext.JSDstInfo, username string) (string, error)

type LegacyDialer added in v1.16.0

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

type NameResolveCachingDialer added in v1.16.0

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

func NewNameResolveCachingDialer added in v1.16.0

func NewNameResolveCachingDialer(next Dialer, resolver Resolver, posTTL, negTTL, timeout time.Duration) *NameResolveCachingDialer

func (*NameResolveCachingDialer) Dial added in v1.16.0

func (nrcd *NameResolveCachingDialer) Dial(network, address string) (net.Conn, error)

func (*NameResolveCachingDialer) DialContext added in v1.16.0

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

func (*NameResolveCachingDialer) Start added in v1.16.0

func (nrcd *NameResolveCachingDialer) Start()

func (*NameResolveCachingDialer) Stop added in v1.16.0

func (nrcd *NameResolveCachingDialer) Stop()

func (*NameResolveCachingDialer) WantsHostname added in v1.16.0

func (nrcd *NameResolveCachingDialer) WantsHostname(ctx context.Context, net, address string) bool

type NameResolvingDialer added in v1.16.0

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

func NewNameResolvingDialer added in v1.16.0

func NewNameResolvingDialer(next Dialer, resolver Resolver) NameResolvingDialer

func (NameResolvingDialer) Dial added in v1.16.0

func (nrd NameResolvingDialer) Dial(network, address string) (net.Conn, error)

func (NameResolvingDialer) DialContext added in v1.16.0

func (nrd NameResolvingDialer) DialContext(ctx context.Context, network, address string) (net.Conn, error)

func (NameResolvingDialer) WantsHostname added in v1.16.0

func (nrd NameResolvingDialer) WantsHostname(ctx context.Context, net, address string) bool

type Resolver added in v1.16.0

type Resolver interface {
	LookupNetIP(ctx context.Context, network, host string) ([]netip.Addr, error)
}

type WrappedHostnameDialer added in v1.16.0

type WrappedHostnameDialer struct {
	Dialer Dialer
}

func (WrappedHostnameDialer) Dial added in v1.16.0

func (w WrappedHostnameDialer) Dial(network, address string) (net.Conn, error)

func (WrappedHostnameDialer) DialContext added in v1.16.0

func (w WrappedHostnameDialer) DialContext(ctx context.Context, network, address string) (net.Conn, error)

func (WrappedHostnameDialer) WantsHostname added in v1.16.0

func (w WrappedHostnameDialer) WantsHostname(_ context.Context, _, _ string) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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