Skip to content
This repository has been archived by the owner on May 24, 2020. It is now read-only.

musaprg/simple-ratelimiter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simple-ratelimiter

A simple ratelimit middleware.

Simple example

You can simply try the ratelimiter in a simple sample program.

About this simple example

This example is a simple HTTP server, which listens to HTTP requests and just returns 200(OK).

If the number of requests has reached the limit, it returns 409 (Too Many Requests),

How to build

cd examples
make

How to run

To run a sample server, execute the command below.

cd examples
./simple-server

The server will be served at localhost:3000.

If you want to limit the number of requests allowed per second, you can configure it via flags.

For example, you can limit to 100 per second,

cd examples
./simple-server --limit 100

About

A simple ratelimit middleware.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages