realip

package
v0.0.0-...-e9665ab Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTooManyAddresses = errors.New("too many addresses")

Functions

func FromRequest

func FromRequest(r *http.Request, proxies []string) (string, error)

FromRequest extracts the real ip address from the request parameters.

If no trusted proxy addresses are given then the result will always be the request's remote address.

In the case where a list of trusted proxies is given then the address to the left of the rightmost address in the x-forwarded-for chain is returned assuming the remote address is also a trusted proxy.

Types

This section is empty.

Jump to

Keyboard shortcuts

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