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
()
| 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 |
no outgoing calls