Skip to content

Commit

Permalink
Fix some casing
Browse files Browse the repository at this point in the history
  • Loading branch information
rnelson committed Nov 27, 2024
1 parent cb85dd0 commit d099659
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,24 +45,24 @@ The response will have some additional headers:

| Header | Description |
| ----------------------- |--------------------------------------------------------------------------------------------------|
| `x-slow-down-limit` | how many requests in total the client can make until the server starts to slow down the response |
| `x-slow-down-remaining` | how many requests remain to the client in the `TimeWindow` |
| `x-slow-down-delay` | how much delay (in milliseconds) has been applied to this request |
| `x-slow-down-limit` | How many requests in total the client can make until the server starts to slow down the response |
| `x-slow-down-remaining` | How many requests remain to the client in the `TimeWindow` |
| `x-slow-down-delay` | How much delay (in milliseconds) has been applied to this request |

## Configuration

| Name | Type | Default Value | Description |
|--------------------------|----------|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `Delay` | number | `1000` | Base unit of time delay applied to requests. It is expressed in milliseconds. Set to `0` to disable delaying. |
| `DelayAfter` | number | `5` | number of requests received during `TimeWindow` before starting to delay responses. Set to `0` to disable delaying. |
| `MaxDelay` | number | `int.MaxValue` | the maximum value of delay that a request has after many consecutive attempts. It is an important option for the server when it is running behind a load balancer or reverse proxy, and has a request timeout. Set to `0` to disable delaying. |
| `TimeWindow` | number | `30000` | The duration of the time window during which request counts are kept in memory. It is expressed in milliseconds. Set to `0` to disable delaying. |
| `AddHeaders` | boolean | `true` | flag to add custom headers `x-slow-down-limit`, `x-slow-down-remaining`, `x-slow-down-delay` for all server responses. |
| `KeyGenerator` | delegate | (req) => req.ip | Function used to generate keys to uniquely identify requests coming from the same user |
| `OnLimitReached` | delegate | `null` | Function that gets called the first time the limit is reached within `TimeWindow`. |
| `SkipFailedRequests` | boolean | `false` | When `true`, failed requests (status >= 400) won't be counted. |
| `SkipSuccessfulRequests` | boolean | `false` | When `true`, successful requests (status < 400) won't be counted. |
| `Skip` | delegate | undefined | Function used to skip requests. Returning `true` from the function will skip limiting for that request. |
| Name | Type | Default Value | Description |
|--------------------------|----------|-----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `Delay` | number | `1000` | Base unit of time delay applied to requests. It is expressed in milliseconds. Set to `0` to disable delaying. |
| `DelayAfter` | number | `5` | Number of requests received during `TimeWindow` before starting to delay responses. Set to `0` to disable delaying. |
| `MaxDelay` | number | `int.MaxValue` | The maximum value of delay that a request has after many consecutive attempts. It is an important option for the server when it is running behind a load balancer or reverse proxy, and has a request timeout. Set to `0` to disable delaying. |
| `TimeWindow` | number | `30000` | The duration of the time window during which request counts are kept in memory. It is expressed in milliseconds. Set to `0` to disable delaying. |
| `AddHeaders` | boolean | `true` | Flag to add custom headers `x-slow-down-limit`, `x-slow-down-remaining`, `x-slow-down-delay` for all server responses. |
| `KeyGenerator` | delegate | (req) => req.ip | Function used to generate keys to uniquely identify requests coming from the same user |
| `OnLimitReached` | delegate | `null` | Function that gets called the first time the limit is reached within `TimeWindow`. |
| `SkipFailedRequests` | boolean | `false` | When `true`, failed requests (status >= 400) won't be counted. |
| `SkipSuccessfulRequests` | boolean | `false` | When `true`, successful requests (status < 400) won't be counted. |
| `Skip` | delegate | `null` | Function used to skip requests. Returning `true` from the function will skip limiting for that request. |

## Configuration examples

Expand Down

0 comments on commit d099659

Please sign in to comment.