Skip to content
This repository has been archived by the owner on Apr 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #12 from nodes-vapor/feature/describe-rate-limit
Browse files Browse the repository at this point in the history
Gatekeeper instead of GateKeeper
  • Loading branch information
mauran committed Nov 17, 2017
2 parents a2f04b7 + 87227d7 commit 0199170
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
[![Readme Score](http://readme-score-api.herokuapp.com/score.svg?url=https://github.com/nodes-vapor/gatekeeper)](http://clayallsopp.github.io/readme-score?url=https://github.com/nodes-vapor/gatekeeper)
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/nodes-vapor/gatekeeper/master/LICENSE)

GateKeeper is a middleware that restricts the number of requests from clients, based on their IP address.
It works by adding the clients IP address to the cache and count how many requests the clients can make during the GateKeepers defined lifespan and give back an HTTP 429(Too Many Requests) if the limit has been reached. The number of requests left will be reset when the defined timespan has been reached
Gatekeeper is a middleware that restricts the number of requests from clients, based on their IP address.
It works by adding the clients IP address to the cache and count how many requests the clients can make during the Gatekeeper's defined lifespan and give back an HTTP 429(Too Many Requests) if the limit has been reached. The number of requests left will be reset when the defined timespan has been reached

**Please take into consideration that multiple clients can be using the same IP address. eg. public wifi**

Expand Down Expand Up @@ -44,7 +44,7 @@ import Gatekeeper
public func setup() throws {
// ...

addConfigurable(middleware: GateKeeper(rate: Rate(10, per: .minute)), name: "gatekeeper")
addConfigurable(middleware: Gatekeeper(rate: Rate(10, per: .minute)), name: "gatekeeper")
}
```

Expand Down

0 comments on commit 0199170

Please sign in to comment.