realip

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromRequest

func FromRequest(r *http.Request) string

FromRequest returns the client's real IP from http request headers. Priority: X-Forwarded-For (leftmost) > X-Real-IP > CF-Connecting-IP > True-Client-IP > X-Client-IP > RemoteAddr X-Forwarded-For format is "client, proxy1, proxy2", so the leftmost IP is the real client.

func RealIP

func RealIP(r *http.Request) string

RealIP is depreciated, use FromRequest instead

Types

This section is empty.

Jump to

Keyboard shortcuts

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