realip

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package realip recovers the client address behind a reverse proxy.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(trusted []netip.Prefix, next http.Handler) http.Handler

Handler sets r.RemoteAddr to the client a trusted proxy reports: the rightmost X-Forwarded-For entry that is not itself a trusted proxy. Requests from anyone else keep their address; their header is ignored.

func Parse

func Parse(list []string) ([]netip.Prefix, error)

Parse reads comma-separated addresses or prefixes: "10.0.0.0/8, 172.18.0.2".

Types

This section is empty.

Jump to

Keyboard shortcuts

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