dialers

package
v0.0.0-...-99b537f Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: MPL-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clear

func Clear()

func Confirm

func Confirm(hostOrIP string, addr netip.Addr) bool

func Confirm2

func Confirm2(hostOrIP string, addr string) bool

func Confirm3

func Confirm3(hostOrIP string, addr net.Addr) bool

Confirm3 marks addr as preferred for hostOrIP

func Dial

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

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 DialBind

func DialBind(d *protect.RDial, network, local, remote string) (net.Conn, error)

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

func DialWithSplitRetry(d *protect.RDial, laddr, raddr *net.TCPAddr) (*retrier, error)

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

func DialWithTls(d protect.RDialer, cfg *tls.Config, network, addr string) (net.Conn, error)

DialWithTls dials into addr using the provided dialer and returns a tls.Conn

func DialWithUTls

func DialWithUTls(d *protect.RDial, cfg *utls.Config, network, addr string) (net.Conn, error)

DialWithUTls dials a uTLS connection to addr and cfg.

func Disconfirm

func Disconfirm(hostOrIP string, addr netip.Addr) bool

Disconfirm unmarks addr as preferred for hostOrIP

func Disconfirm2

func Disconfirm2(hostOrIP string, addr string) bool

Disconfirm2 unmarks addr as preferred for hostOrIP

func Disconfirm3

func Disconfirm3(hostOrIP string, addr net.Addr) bool

Disconfirm3 unmarks addr as preferred for hostOrIP

func ECH

func ECH(hostname string) ([]byte, error)

ECH returns the ECH config, if any, for the given hostname. The query is resolved using IPMapper's default resolver.

func For

func For(hostOrIP string) []netip.Addr

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 IPProtos

func IPProtos(ippro string) (diff bool)

p must be one of settings.IP4, settings.IP6, or settings.IP46

func Listen

func Listen(d *protect.RDial, network, local string) (net.Listener, error)

Listen listens on for TCP connections on the local address using d.

func ListenPacket

func ListenPacket(d *protect.RDial, network, local string) (net.PacketConn, error)

ListenPacket listens on for UDP connections on the local address using d. Returned net.Conn is guaranteed to be a *net.UDPConn.

func Mapper

func Mapper(m ipmap.IPMapper)

Mapper is a hostname to IP (a/aaaa) resolver for the network engine; may be nil.

func New

func New(hostOrIP string, ipps []string) (*ipmap.IPSet, bool)

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

func NewProtected(hostOrIP string, ipps []string) (*ipmap.IPSet, bool)

hostOrIP may be host:port, or ip:port, or host, or ip.

func NewUTLSCfg

func NewUTLSCfg(host string) *utls.Config

func Probe

func Probe(d *protect.RDial, network, local string) (net.PacketConn, error)

Probe sends and accepts ICMP packets on local addr using d over a net.PacketConn.

func ProxyDial

func ProxyDial(d proxy.Dialer, network, addr string) (net.Conn, error)

ProxyDial tries to connect to addr using d

func ProxyDials

func ProxyDials(dd []proxy.Dialer, network, addr string) (c net.Conn, err error)

ProxyDials tries to connect to addr using each dialer in dd

func Query

func Query(msg *dns.Msg) (*dns.Msg, error)

Query sends a DNS query to the Default DNS and returns the answer.

func Resolve

func Resolve(hostname string) ([]netip.Addr, error)

Resolve resolves hostname to IP addresses, bypassing cache. If resolution fails, entries from the cache are returned, if any.

func ResolveOn

func ResolveOn(nom string, tids ...string) ([]netip.Addr, error)

ResolveOn resolves nom to IPs on given DNS transport IDs, tids.

func SplitDial

func SplitDial(d *protect.RDial, network, addr string) (net.Conn, error)

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

func SplitDialBind(d *protect.RDial, network, local, remote string) (net.Conn, error)

func TlsDial

func TlsDial(d *tls.Dialer, network, addr string) (net.Conn, error)

func Use4

func Use4() bool

func Use6

func Use6() bool

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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