WebApiThrottle | ASP.NET Web API rate limiter for IIS and Owin hosting | REST library
kandi X-RAY | WebApiThrottle Summary
kandi X-RAY | WebApiThrottle Summary
ASP.NET Web API Throttling handler, OWIN middleware and filter are designed to control the rate of requests that clients can make to a Web API based on IP address, client API key and request route. WebApiThrottle package is available on NuGet at [nuget.org/packages/WebApiThrottle] Web API throttling can be configured using the built-in ThrottlePolicy. You can set multiple limits for different scenarios like allowing an IP or Client to make a maximum number of calls per second, per minute, per hour per day or even per week. You can define these limits to address all requests made to an API or you can scope the limits to each API route. If you are looking for the ASP.NET Core version please head to [AspNetCoreRateLimit] project. AspNetCoreRateLimit is a full rewrite of WebApiThrottle and offers more flexibility in configuring rate limiting for Web API and MVC apps.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of WebApiThrottle
WebApiThrottle Key Features
WebApiThrottle Examples and Code Snippets
Community Discussions
Trending Discussions on WebApiThrottle
QUESTION
Given the following
- ASP.NET Web API application
- Target: .NET Framework 4.6.1
- Hosted as Azure App Service
I wish to restrict the total number of concurrent HTTP requests to the application.
I have looked at https://github.com/stefanprodan/WebApiThrottle but that seems to be focused on different use cases.
I would like the equivalent of this setting in IIS: https://forums.asp.net/t/1683143.aspx?Max+concurrent+requests
...ANSWER
Answered 2017-Jul-11 at 06:55This is to avoid attacking a backend service in counterproductive ways.
To avoid the attack, you could restrict the concurrent requests using Dynamic IP Restrictions. If the concurrent requests count is larger than the setting value, the IP address will be blocked.
QUESTION
I have a WebApi in ASP.NET MVC and I need to control the limit of access and besides that I need to change the values of the limits at run time. I implemented like this example on this site WebApiThrottle (section Update rate limits at runtime)
That's the code in my WebApiConfig:
...ANSWER
Answered 2017-Jul-03 at 13:49After try a lot of things I could configure my class to consider my custom rate limits.
What I did was:
1) I created a class to override the method SetIdentity like in the site WebApiThrottle:
QUESTION
There's a real nice library WebApiThrottle for API rate limiting in Web API.
As mentioned on the Wiki page, I can rate limit the API based on the authorization token header of API call.
But, how can I block the api call for the next 5 minutes if this api rate limit exceeds? Also, not that any request within next 5 minutes will reset the rate limiting exceeded time.
I checked the code but couldn't find this feature. Any other way if someone can suggest?
...ANSWER
Answered 2017-Mar-04 at 08:38For the time being, I'm using this fork of WebApiThrottle and adding the dll manually to the solution. @adamriyadi has implemented this feature in the fork. Waiting for it to come to NuGet package.
Update: Later, I went with my own implementation for API rate limiting with blocking period using HttpRuntime.Cache
. So there is no need to add any additional library.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install WebApiThrottle
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page