network

package
v1.13.4 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package network contains helpers for deciding which network destinations Wings may connect to on behalf of a user.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAllowed

func IsAllowed(allowlist []string, host string, addr netip.Addr) bool

IsAllowed reports whether a connection to the address, resolved from the host, is allowed by an allowlist configured by the operator. Entries may be host names, IP addresses or CIDR ranges.

func IsInternal

func IsInternal(addr netip.Addr) bool

IsInternal reports whether the address is anything other than a globally reachable unicast address.

func LimitListener

func LimitListener(l net.Listener, n int, name string) net.Listener

LimitListener returns a listener that accepts at most n connections at once, like netutil.LimitListener. Once the limit is reached, new connections wait for an open one to close without anything else being logged, so this logs a warning, at most once a minute, whenever the limit is reached.

Types

This section is empty.

Jump to

Keyboard shortcuts

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