publicdial

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2026 License: AGPL-3.0 Imports: 16 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 publicdial pins untrusted discovery traffic to locally permitted public addresses.

Index

Constants

This section is empty.

Variables

View Source
var ErrAddress = errors.New("discovery requires a public HTTPS endpoint")

Functions

This section is empty.

Types

type Policy

type Policy struct {
	Lookup          func(context.Context, string, string) ([]netip.Addr, error)
	Permit          func(netip.Addr) bool
	Dial            func(context.Context, string, string) (net.Conn, error)
	FallbackDelay   time.Duration
	TLSClientConfig *tls.Config
}

func (Policy) Client

func (p Policy) Client() *http.Client

func (Policy) Origin

func (p Policy) Origin(raw string) (*url.URL, error)

Origin validates a public HTTPS origin (root path "" or "/" only), suitable for configured discovery seeds where non-root paths indicate user typos.

func (Policy) Permits

func (p Policy) Permits(ip netip.Addr) bool

func (Policy) RelayOrigin

func (p Policy) RelayOrigin(raw string) (*url.URL, error)

RelayOrigin extracts the root discovery origin from a public HTTPS relay base URL, allowing valid subpath mounts because /.well-known/windshare and /discovery/v1/peers always live at the origin root.

Jump to

Keyboard shortcuts

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