clientnet

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package clientnet classifies authenticated frontend peer and proxy addresses.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientNet

func ClientNet(r *http.Request, trusted ...netip.Prefix) (netip.Addr, bool)

ClientNet classifies the peer and returns its client address. Forwarding headers are trusted only from loopback or explicitly configured proxies. Malformed chains fail closed. A public hop cannot be hidden by a preceding client-supplied private address.

func LAN

func LAN(ip netip.Addr) bool

LAN reports whether an address belongs to a LAN or overlay network.

func ProxyPrefixes

func ProxyPrefixes(cidrs []string) []netip.Prefix

ProxyPrefixes parses configured peer networks. Invalid entries grant no trust.

Types

This section is empty.

Jump to

Keyboard shortcuts

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