publicaddr

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2026 License: Apache-2.0 Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package publicaddr decides which addresses relay may send a request to when the URL comes from a caller (a webhook receiver, a token endpoint): public unicast only, so a caller cannot reach loopback, private networks, link-local services such as a cloud metadata endpoint, or the relay host itself.

It decides on resolved IPs, never on hostnames: Refused checks one address, and DialControl checks the address a net.Dialer is about to connect to, after DNS. Redirects, proxies and URL syntax are the caller's concern.

Index

Constants

This section is empty.

Variables

View Source
var ErrRefused = errors.New("address is not a public unicast address")

ErrRefused is the error for an address that is not public unicast.

Functions

func DialControl

func DialControl(_, address string, _ syscall.RawConn) error

DialControl is a net.Dialer Control function that refuses to connect to a refused address. address is the resolved "ip:port" the dialer is connecting to.

func Refused

func Refused(a netip.Addr) bool

Refused reports whether a is refused: loopback, RFC 1918, link-local, CGNAT, IPv6 ULA and site-local, unspecified, multicast, benchmarking, IPv4-embedding IPv6 ranges and reserved ranges.

Types

This section is empty.

Jump to

Keyboard shortcuts

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