KnowYourLimits 1.0.1
See the version list below for details.
dotnet add package KnowYourLimits --version 1.0.1
NuGet\Install-Package KnowYourLimits -Version 1.0.1
<PackageReference Include="KnowYourLimits" Version="1.0.1" />
paket add KnowYourLimits --version 1.0.1
#r "nuget: KnowYourLimits, 1.0.1"
// Install KnowYourLimits as a Cake Addin #addin nuget:?package=KnowYourLimits&version=1.0.1 // Install KnowYourLimits as a Cake Tool #tool nuget:?package=KnowYourLimits&version=1.0.1
KnowYourLimits
A rate limiting library for .Net projects.
Currently provides a middleware:
- AspNet Core
Available rate limiting strategies:
- Leaky Bucket
When a client exceeds their request limit, a 429 Too Many Requests
status will be returned.
Setup
The middleware should be attached to the application as high in the order as possible, to intercept requests early.
Pass your rate limiting strategy into the middleware:
var rateLimitingConfiguration = new LeakyBucketConfiguration
{
MaxRequests = 10,
LeakRate = TimeSpan.FromHours(1),
IdentityProvider = new CustomIdentityProvider() // If not set, defaults to using the remote address
};
app.UseRateLimiting(new LeakyBucketRateLimitStrategy(rateLimitingConfiguration));
By default client requests will be identified using the remote address of the request. To implement a custom identity provider, implement the IClientIdentityProvider
interface and pass it in to the configuration.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 is compatible. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
-
.NETCoreApp 2.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on KnowYourLimits:
Package | Downloads |
---|---|
KnowYourLimits.AspNetCore
A rate limiting middleware for AspNetCore. |
GitHub repositories
This package is not used by any popular GitHub repositories.