Documentation
¶
Overview ¶
Package realip extracts a real IP address from the request.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Get ¶
Get returns real IP from the given request. It checks headers in the following priority order:
- X-Real-IP - trusted proxy (nginx/reproxy) sets this to actual client
- CF-Connecting-IP - Cloudflare's header for original client
- X-Forwarded-For - leftmost public IP (original client in CDN chain)
- RemoteAddr - fallback for direct connections
Only public IPs are accepted from headers; private/loopback/link-local IPs are skipped.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.