dialer

package
v0.0.0-...-b5ba5ed Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SupportsReusePort = false

Functions

func DialContext

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

DialContext dials via context and/or directly, depending on how it is configured. If dialing via proxy and allowing fallback, dialing for both happens simultaneously and the proxy connection is returned if successful.

func DialContextReusePortFunc

func DialContextReusePortFunc(registry *registry.Registry) func(ctx context.Context, network, addr string) (net.Conn, error)

DialContextReusePort tries dialing via proxy if a proxy is configured, and falls back to a direct connection reusing the port from the connections registry, if no proxy is defined, or connecting via proxy fails. It also in parallel dials without reusing the port, just in case reusing the port affects routing decisions badly.

func ReusePortControl

func ReusePortControl(_, _ string, c syscall.RawConn) error

func SetTCPOptions

func SetTCPOptions(conn net.Conn) error

SetTCPOptions sets our default TCP options on a TCP connection, possibly digging through dialerConn to extract the *net.TCPConn

func SetTrafficClass

func SetTrafficClass(conn net.Conn, class int) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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