Documentation
¶
Overview ¶
Package fiber provides rate limiting middleware for the Fiber v3 web framework. It features IP spoofing protection with trusted proxy CIDR filtering and custom key extraction.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractClientIP ¶
ExtractClientIP securely extracts the client's real IP address from a Fiber v3 fiber.Ctx. Header values (X-Forwarded-For, X-Real-IP) are parsed only if c.IP() originates from a trusted proxy.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config holds configuration parameters for the Fiber rate limit middleware.
type Option ¶
type Option func(*Config)
Option configures functional parameters for the Fiber rate limit middleware.
func WithKeyFunc ¶
WithKeyFunc configures a custom key extraction function based on fiber.Ctx.
func WithRouteLabeling ¶ added in v1.2.0
WithRouteLabeling enables passing the Fiber route path pattern (e.g. /api/v1/users/:id) as the route label in telemetry events.
func WithTrustedProxies ¶
WithTrustedProxies configures a list of trusted proxy IPs or CIDR networks for safely parsing X-Forwarded-For headers.