config

package
v0.0.0-...-69fac63 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2026 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SafeDialContext

func SafeDialContext(base *net.Dialer, enableIPv6 bool) func(ctx context.Context, network, addr string) (net.Conn, error)

SafeDialContext 封装 DNS fallback 的拨号逻辑

Types

type DialContextWrapper

type DialContextWrapper struct {
	Base       proxy.Dialer
	EnableIPv6 bool
}

func (*DialContextWrapper) Dial

func (d *DialContextWrapper) Dial(network, addr string) (net.Conn, error)

func (*DialContextWrapper) DialContext

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

创建sync.Pool用于复用dialResult对象

var dialResultPool = sync.Pool{
	New: func() interface{} {
		return &dialResult{}
	},
}

type HttpProxyDialer

type HttpProxyDialer struct {
	ProxyAddr string
	Headers   map[string]string
}

httpProxyDialer 实现 proxy.Dialer 接口

func (*HttpProxyDialer) Dial

func (d *HttpProxyDialer) Dial(network, addr string) (net.Conn, error)

type SocksDialerWrapper

type SocksDialerWrapper struct {
	DialFn func(network, addr string) (net.Conn, error)
}

func (*SocksDialerWrapper) Dial

func (w *SocksDialerWrapper) Dial(network, addr string) (net.Conn, error)

Jump to

Keyboard shortcuts

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