Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/koajs/maxrequests
Limit max requests on each http keepalive connection.
https://github.com/koajs/maxrequests
Last synced: 2 months ago
JSON representation
Limit max requests on each http keepalive connection.
- Host: GitHub
- URL: https://github.com/koajs/maxrequests
- Owner: koajs
- License: mit
- Created: 2016-06-12T09:00:38.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-09-09T14:40:15.000Z (over 4 years ago)
- Last Synced: 2024-04-14T13:08:40.563Z (8 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 2
- Watchers: 8
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: History.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-koa - maxrequests - Limit max requests on each http keepalive connection. (Middleware)
README
# maxrequests
[![NPM version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
[![Test coverage][codecov-image]][codecov-url]
[![David deps][david-image]][david-url]
[![Known Vulnerabilities][snyk-image]][snyk-url]
[![npm download][download-image]][download-url][npm-image]: https://img.shields.io/npm/v/koa-maxrequests.svg?style=flat-square
[npm-url]: https://npmjs.org/package/koa-maxrequests
[travis-image]: https://img.shields.io/travis/koajs/maxrequests.svg?style=flat-square
[travis-url]: https://travis-ci.org/koajs/maxrequests
[codecov-image]: https://codecov.io/gh/koajs/maxrequests/branch/master/graph/badge.svg
[codecov-url]: https://codecov.io/gh/koajs/maxrequests
[david-image]: https://img.shields.io/david/koajs/maxrequests.svg?style=flat-square
[david-url]: https://david-dm.org/koajs/maxrequests
[snyk-image]: https://snyk.io/test/npm/koa-maxrequests/badge.svg?style=flat-square
[snyk-url]: https://snyk.io/test/npm/koa-maxrequests
[download-image]: https://img.shields.io/npm/dm/koa-maxrequests.svg?style=flat-square
[download-url]: https://npmjs.org/package/koa-maxrequestsLimit max requests on each http keepalive connection.
## Install
```bash
$ npm install koa-maxrequests
```## Usage
```js
const maxrequests = require('koa-maxrequests');
const koa = require('koa');const app = koa();
app.use(maxrequests({
// if keepalive socket hit max requests, response will set `Connection: close` header.
max: 1000,
}));
```## License
[MIT](LICENSE.txt)