MCPcopy
hub / github.com/gofiber/fiber / IP

Method IP

req_interface_gen.go:104–104  ·  view source on GitHub ↗

IP returns the client's IP address. When the request comes from a trusted proxy (see [TrustProxyConfig]), the value is extracted from the configured ProxyHeader by walking the X-Forwarded-For chain right-to-left and skipping all trusted proxy IPs; the first non-trusted IP in the chain is returned. P

()

Source from the content-addressed store, hash-verified

102 // non-trusted IP in the chain is returned. Please use Config.TrustProxy to prevent header
103 // spoofing if your app is behind a proxy.
104 IP() string
105 // extractIPsFromHeader will return a slice of IPs it found given a header name in the order they appear.
106 // When IP validation is enabled, any invalid IPs will be omitted.
107 extractIPsFromHeader(header string) []string

Implementers 1

Calls

no outgoing calls