当前位置:网站首页>Aspnetcoreratelimit rate limit interface access limit current limit control
Aspnetcoreratelimit rate limit interface access limit current limit control
2022-06-28 04:19:00 【KingCruel】
AspNetCoreRateLimit It's a kind of ASP.NET Core Rate limiting solution , Designed to control the client can according to IP Address or client ID towards Web API or MVC Rate of requests from applications .AspNetCoreRateLimit The bag contains a IpRateLimitMiddleware And a ClientRateLimitMiddleware, For each middleware , You can set multiple restrictions for different scenarios , For example, allow IP Or clients per second 、15 The maximum number of calls made in a time interval of minutes . You can define these limitations to address the problem of API All requests made , Or you can limit the scope to each API URL or HTTP Verbs and paths .
github Address
https://github.com/stefanprodan/AspNetCoreRateLimit
function
client-based IP The speed limit of
● Set up and configure
● Define rate limit rules
● Behavior
● Runtime update rate limit
client-based ID The speed limit of
● Set up and configure
● Define rate limit rules
● Behavior
● Runtime update rate limit
Advanced configuration
● Custom quota exceeded response
●IP / ClientId Analyze contributors
● Use Redis Stored as a distributed counter
management NuGet Package (N)...
AspNetCoreRateLimit
AspNetCoreRateLimit.Redis1、Startup.cs
*
*
*
*
2、appsettings.json
"IpRateLimiting": {
"EnableEndpointRateLimiting": false,
"StackBlockedRequests": false,
"RealIpHeader": "X-Real-IP",
"ClientIdHeader": "X-ClientId",
"HttpStatusCode": 429,
"IpWhitelist": [ "127.0.0.1", "::1/10", "192.168.0.0/24" ],
"EndpointWhitelist": [ "get:/api/license", "*:/api/status" ],
"ClientWhitelist": [ "dev-id-1", "dev-id-2" ],
"GeneralRules": [
{
"Endpoint": "*",
"Period": "1s",
"Limit": 2
},
{
"Endpoint": "*",
"Period": "15m",
"Limit": 100
},
{
"Endpoint": "*",
"Period": "12h",
"Limit": 1000
},
{
"Endpoint": "*",
"Period": "7d",
"Limit": 10000
}
]
}*
*
*
边栏推荐
- Several important physical concepts
- Resolve cross domain
- Uncover the mystery of SSL and learn how to protect data with SSL
- 僅用遞歸函數和棧操作逆序一個棧
- How can we speed up the chunksplitter when CDC extracts MySQL data in full?
- 利用ELK 搭建日志分析系统(二)—— 部署安装
- 单一职责原则
- Reverse a stack with recursive functions and stack operations only
- leetcode - 329. Longest increasing path in matrix
- Tiktok practice ~ pay attention to bloggers
猜你喜欢

Digital promising, easy to reach, Huawei accelerates the layout of the commercial market with "five pole" star products

Multithreading and high concurrency III: AQS underlying source code analysis and implementation classes

Lingge leangoo agile Kanban tool adds the functions of exporting card documents and pasting shared brain map nodes

RT thread bidirectional linked list (learning notes)

27年,微软IE结束了!

揭开SSL的神秘面纱,了解如何用SSL保护数据

Open the field of maker education and creation

Multithreading and high concurrency IV: varhandle, strong weak virtual reference and ThreadLocal

@Transactional失效的几种场景

Secouer le son et se battre ~ prêter attention au blogueur
随机推荐
简单工厂模式
Using elk to build a log analysis system (I) -- component introduction
A queue of two stacks
The company leader said that if the personal code exceeds 10 bugs, he will be dismissed. What is the experience?
基于arm5718的Shell脚本参数传递的2种方法
Two methods of shell script parameter passing based on arm5718
公司领导说,个人代码超10个Bug就开除,是什么体验?
窗帘做EN 1101易燃性测试过程是怎么样的?
政策利好,20多省市开启元宇宙发展规划
first. Net core MVC project
Multithreading and high concurrency III: AQS underlying source code analysis and implementation classes
机器学习入门笔记
AS 3744.1标准中提及ISO8191测试,两者测试一样吗?
【MySQL】多表连接查询
Are the two flame retardant standards of European furniture en 597-1 and en 597-2 the same?
Multi project design and development · introduction to class library project
PostgreSQL implements batch update, deletion and insertion
Password encryption MD5 and salt treatment
软件测试报告怎么编写?第三方性能报告范文模板来了
Building log analysis system with elk (II) -- deployment and installation