clientip

package
v1.28.6 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: Apache-2.0, MIT Imports: 5 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 IP resolved by Middleware. The RemoteAddr fallback keeps independently-mounted handlers safe and usable in tests.

func Middleware

func Middleware(next http.Handler) http.Handler

Middleware resolves the client IP from the TCP peer by default. A loopback peer is treated as one trusted reverse-proxy hop, matching Curio's documented same-host proxy setup. The proxy must overwrite or append X-Forwarded-For.

func RateLimitKey

func RateLimitKey(r *http.Request) (string, error)

RateLimitKey returns a normalized per-client key. IPv6 clients are grouped by /64 so rotating addresses within one delegated subnet cannot evade a limit.

Types

This section is empty.

Jump to

Keyboard shortcuts

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