netutil

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientIP

func ClientIP(r *http.Request, trustProxy bool) string

ClientIP returns the client IP for visitor hashing and filtering. When trustProxy is true, X-Forwarded-For / X-Real-IP are scanned for the first global-unicast address; private and loopback hops are skipped.

func IsPrivateOrLoopback

func IsPrivateOrLoopback(ip net.IP) bool

IsPrivateOrLoopback reports RFC1918, loopback, link-local, and ULA addresses.

Types

This section is empty.

Jump to

Keyboard shortcuts

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