# http-frequency

> 一个中间件用于限制给定ip地址的客户端每秒请求HTTP服务器的次数

Latest version **1.0.1** (published 2019-02-22) · ISC license · 0 weekly downloads

## Install

```sh
npm install http-frequency
pnpm add http-frequency
yarn add http-frequency
bun add http-frequency
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2019-02-22 |
| First published | 2019-02-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 10.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | giscyw |
| Maintainers | giscyw |

## Links

- npm: https://www.npmjs.com/package/http-frequency
- npm.io page: https://npm.io/package/http-frequency

## Recent versions

- 1.0.1 (latest) — 2019-02-22
- 1.0.0 — 2019-02-22

## README

一个中间件用于限制给定ip地址的客户端每秒请求HTTP服务器的次数

### API

- httpFrequency()

  默认是30次，即每秒限制同一ip地址的客户端请求次数顶多为30次

- httpFrequency(options)
  options可以为number或者object类型，object类型需要指定frequency

## 示例

```javascript
var express = require('express');
var app = express();

var httpFrequency = require('http-frequency');

app.use(httpFrequency());

app.get('/login', httpFrequency(10), function(req, res){
    res.send('login');
});

app.get('/register', httpFrequency({frequency:20}), function(req, res){
    res.send('register');
});
```

---
_Source: https://npm.io/package/http-frequency · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
