github.com/go-chi/httprate

httprate

net/http rate limiter middleware

81

Decision Signals

Health score 81/100, confidence 95/100.

Strong
Maintenance 61
Adoption 97
Security 92
Maturity 87
Developer DX 69
Confidence 95

Install

go get github.com/go-chi/httprate

Package Data

updated May 29, 2026
Latest versionv0.15.0
Imported by256 packages
Stars458
Forks22
Last activity7 months ago
Latest releasev0.15.0 (1 years ago)
LicenseMIT
Known vuln records0

API Surface

40 symbols
SymbolKindSynopsis
KeyFunc Type type KeyFunc func(r *http.Request) (string, error)
LimitCounter Type type LimitCounter interface{ ... }
LimitCounter.Config Method Config func(requestLimit int, windowLength time.Duration)
LimitCounter.Get Method Get func(key string, currentWindow, previousWindow time.Time) (int, int, error)
LimitCounter.Increment Method Increment func(key string, currentWindow time.Time) error
LimitCounter.IncrementBy Method IncrementBy func(key string, currentWindow time.Time, amount int) error
Option Type type Option func(rl *RateLimiter)
WithErrorHandler Function func WithErrorHandler(h func(http.ResponseWriter, *http.Request, error)) Option
WithKeyByIP Function func WithKeyByIP() Option
WithKeyByRealIP Function func WithKeyByRealIP() Option
WithKeyFuncs Function func WithKeyFuncs(keyFuncs ...KeyFunc) Option
WithLimitCounter Function func WithLimitCounter(c LimitCounter) Option

Similar Packages

Go Rate Limiting Libraries

#1 go-limiter

Package limiter defines rate limiting systems.

Go Rate Limiting Libraries 716 stars 66 imported-by 95% confidence
84

#2 httprl

Package httprl provides a rate limiter for http servers.

Go Rate Limiting Libraries 5 stars 56 imported-by 95% confidence
78

#3 v3

Dead simple rate limit middleware for Go.

Go Rate Limiting Libraries 2.3K stars 341 imported-by 95% confidence
77

#4 caddy-waf

Package caddywaf implements a Web Application Firewall (WAF) middleware for Caddy.

Go Rate Limiting Libraries 774 stars 0 imported-by 75% confidence
77

#5 ratelimit

A Go blocking leaky-bucket rate limit implementation

Go Rate Limiting Libraries 4.7K stars 984 imported-by 75% confidence
71