Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dchest/throttled-webrate
Another RateLimit for throttled
https://github.com/dchest/throttled-webrate
Last synced: about 1 month ago
JSON representation
Another RateLimit for throttled
- Host: GitHub
- URL: https://github.com/dchest/throttled-webrate
- Owner: dchest
- Created: 2015-04-15T13:47:24.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-10-22T10:35:32.000Z (about 9 years ago)
- Last Synced: 2024-04-15T01:16:17.106Z (7 months ago)
- Language: Go
- Homepage:
- Size: 135 KB
- Stars: 10
- Watchers: 5
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
webrate
-------Package webrate contains a modified RateLimit function for
http://github.com/PuerkitoBio/throttled, which rate limits only specified
HTTP methods and doesn't add headers to response.EXAMPLE
import (
"net/http""github.com/PuerkitoBio/throttled"
"github.com/PuerkitoBio/throttled/store"
"github.com/dchest/throttled-webrate"
)func main() {
// ...
th := webrate.RateLimit(
throttled.PerMin(30),
[]string{"POST"},
webrate.VaryByPathAndIP("X-Real-IP"),
store.NewMemStore(1000))
http.Handle("/login", th.Throttle(loginHandler))// ...
}