nitrojs / nitrojs/nitro

Support rate limiter

Open
#2,168 0 comments 20 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

discussion enhancement v2
Dominant language
TypeScript
Stars
11.2k
Forks
899
Avg merge
2d 24m
Merged PRs (30d)
40

Description

It could be a route rule or an external nitro module. (community contribution is welcome! an example template for module: here)

The main thing to note is that any rate limiter implemented to run within the event loop shares some limitations:

  • It can NOT be trusted as a security measurement against DOS attacks.
  • It can barely handle multi instance / cluster deployments

So in general, I would highly advice to depend on a Reverse Proxy (like nginx) or CDN (like cloudflare) to handle rate limiting.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing Nitro's route-rule mechanism and the linked nitro-cloudflare-dev module template, then compare those options with the reverse-proxy guidance for nginx or a CDN. Done requires choosing and implementing a concrete rate-limiting approach, with its event-loop, multi-instance, and DoS limitations clearly addressed.

Written by the indexing model from the issue text.

Assessment

Tech stack
nginx, typescript
Domain
backend, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.