Documentation ¶
Index ¶
- func Clear()
- func Confirm(hostOrIP string, addr netip.Addr) bool
- func Confirm2(hostOrIP string, addr string) bool
- func Confirm3(hostOrIP string, addr net.Addr) bool
- func Dial(d *protect.RDial, network, addr string) (net.Conn, error)
- func DialBind(d *protect.RDial, network, local, remote string) (net.Conn, error)
- func DialBindWithTls(d protect.RDialer, cfg *tls.Config, network, local, remote string) (net.Conn, error)
- func DialWithSplitRetry(d *protect.RDial, laddr, raddr *net.TCPAddr) (*retrier, error)
- func DialWithTls(d protect.RDialer, cfg *tls.Config, network, addr string) (net.Conn, error)
- func DialWithUTls(d *protect.RDial, cfg *utls.Config, network, addr string) (net.Conn, error)
- func Disconfirm(hostOrIP string, addr netip.Addr) bool
- func Disconfirm2(hostOrIP string, addr string) bool
- func Disconfirm3(hostOrIP string, addr net.Addr) bool
- func ECH(hostname string) ([]byte, error)
- func For(hostOrIP string) []netip.Addr
- func IPProtos(ippro string) (diff bool)
- func Listen(d *protect.RDial, network, local string) (net.Listener, error)
- func ListenPacket(d *protect.RDial, network, local string) (net.PacketConn, error)
- func Mapper(m ipmap.IPMapper)
- func New(hostOrIP string, ipps []string) (*ipmap.IPSet, bool)
- func NewProtected(hostOrIP string, ipps []string) (*ipmap.IPSet, bool)
- func NewUTLSCfg(host string) *utls.Config
- func Probe(d *protect.RDial, network, local string) (net.PacketConn, error)
- func ProxyDial(d proxy.Dialer, network, addr string) (net.Conn, error)
- func ProxyDials(dd []proxy.Dialer, network, addr string) (c net.Conn, err error)
- func Query(msg *dns.Msg) (*dns.Msg, error)
- func Resolve(hostname string) ([]netip.Addr, error)
- func ResolveOn(nom string, tids ...string) ([]netip.Addr, error)
- func SplitDial(d *protect.RDial, network, addr string) (net.Conn, error)
- func SplitDialBind(d *protect.RDial, network, local, remote string) (net.Conn, error)
- func TlsDial(d *tls.Dialer, network, addr string) (net.Conn, error)
- func Use4() bool
- func Use6() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Dial ¶
Dial dials into addr using the provided dialer and returns a net.Conn, which is guaranteed to be either net.UDPConn or net.TCPConn
func DialBindWithTls ¶
func DialBindWithTls(d protect.RDialer, cfg *tls.Config, network, local, remote string) (net.Conn, error)
DialWithTls dials into addr using the provided dialer and returns a tls.Conn
func DialWithSplitRetry ¶
DialWithSplitRetry returns a TCP connection that transparently retries by splitting the initial upstream segment if the socket closes without receiving a reply. Like net.Conn, it is intended for two-threaded use, with one thread calling Read and CloseRead, and another calling Write, ReadFrom, and CloseWrite. `dialer` will be used to establish the connection. `addr` is the destination.
func DialWithTls ¶
DialWithTls dials into addr using the provided dialer and returns a tls.Conn
func DialWithUTls ¶
DialWithUTls dials a uTLS connection to addr and cfg.
func Disconfirm ¶
Disconfirm unmarks addr as preferred for hostOrIP
func Disconfirm2 ¶
Disconfirm2 unmarks addr as preferred for hostOrIP
func Disconfirm3 ¶
Disconfirm3 unmarks addr as preferred for hostOrIP
func ECH ¶
ECH returns the ECH config, if any, for the given hostname. The query is resolved using IPMapper's default resolver.
func For ¶
For returns addresses for hostOrIP from cache, resolving them if missing. Underlying cache relies on Disconfirm() to remove unreachable IP addrs; if not called, these entries may go stale. Use Resolve() to bypass cache. hostOrIP may be host:port, or ip:port, or host, or ip.
func ListenPacket ¶
ListenPacket listens on for UDP connections on the local address using d. Returned net.Conn is guaranteed to be a *net.UDPConn.
func New ¶
New re-seeds hostOrIP with a new set of ips. hostOrIP may be host:port, or ip:port, or host, or ip. ipps may be ip or ip:port.
func NewProtected ¶
hostOrIP may be host:port, or ip:port, or host, or ip.
func NewUTLSCfg ¶
func ProxyDials ¶
ProxyDials tries to connect to addr using each dialer in dd
func Resolve ¶
Resolve resolves hostname to IP addresses, bypassing cache. If resolution fails, entries from the cache are returned, if any.
func SplitDial ¶
SplitDial dials into addr splitting the first segment to two if the first connection is unsuccessful, using settings.DialStrategy. Returns a net.Conn, which may not be net.UDPConn or net.TCPConn.
func SplitDialBind ¶
Types ¶
This section is empty.