netbind

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package netbind resolves operator-friendly local-address specifications for connections that must bypass a host TUN route.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsDynamic added in v0.3.0

func IsDynamic(spec string) bool

IsDynamic reports whether resolving spec depends on live interface state. Literal addresses are stable configuration; automatic and interface-bound specifications can disappear and reappear as links change.

func Resolve

func Resolve(spec string) (netip.Addr, error)

Resolve returns the address selected by a literal IP, "if:NAME", or "auto". Automatic and interface modes deliberately consider only IPv4 addresses on active, non-loopback, non-point-to-point interfaces. Excluding point-to-point interfaces prevents a Clash or other host TUN from being selected as the outer path. Ambiguity is reported instead of guessing.

func Validate

func Validate(spec string) error

Validate checks a literal IP, "auto", or "if:NAME" without requiring the interface to be present yet. Interface state can change between validation and a later dial, so Resolve repeats this check.

Types

This section is empty.

Jump to

Keyboard shortcuts

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