Aiursoft.WebTools
10.0.24
dotnet add package Aiursoft.WebTools --version 10.0.24
NuGet\Install-Package Aiursoft.WebTools -Version 10.0.24
<PackageReference Include="Aiursoft.WebTools" Version="10.0.24" />
<PackageVersion Include="Aiursoft.WebTools" Version="10.0.24" />
<PackageReference Include="Aiursoft.WebTools" />
paket add Aiursoft.WebTools --version 10.0.24
#r "nuget: Aiursoft.WebTools, 10.0.24"
#:package Aiursoft.WebTools@10.0.24
#addin nuget:?package=Aiursoft.WebTools&version=10.0.24
#tool nuget:?package=Aiursoft.WebTools&version=10.0.24
Aiursoft WebTools
<a name="aiursoft-webtools"></a>
A collection of tools for web development.
Overview
What is WebTools?
<a name="features"></a>
- Easier application startup
- QRCode generation
- HttpContext extensions
Installation
Add the package to your .NET project:
<a name="how-to-install"></a>
To install Aiursoft.WebTools to your project from nuget.org:
dotnet add package Aiursoft.WebTools
Requires .NET 10 or later.
Usage
<a name="easier-application-startup"></a>
It is a common practice to create a Program class and a Startup class in a ASP.NET Core application. However, it is a little bit annoying to write the same code again and again. So we created a Extends class to help you to write less code.
using System.Reflection;
using Aiursoft.WebTools;
using Aiursoft.WebTools.Abstractions.Models;
namespace DemoApp;
public class Program
{
public static async Task Main(string[] args)
{
var app = await Extends.AppAsync<Startup>(args);
await app.RunAsync();
}
}
public class Startup : IWebStartup
{
public void ConfigureServices(IConfiguration configuration, IWebHostEnvironment environment, IServiceCollection services)
{
services
.AddControllers()
.AddApplicationPart(Assembly.GetExecutingAssembly());
}
public void Configure(WebApplication app)
{
app.UseRouting();
app.MapDefaultControllerRoute();
}
}
QRCode generation
<a name="qrcode-generation"></a>
We provide a QRCode generation service for you to generate QRCode image from a string.
var base64 = _qrCodeService.ToQRCodeBase64(somestring);
HttpContext extensions
<a name="httpcontext-extensions"></a>
We provide some useful extensions for HttpContext:
var isWeChat = HttpContext.Request.IsWeChat();
var isMobile = HttpContext.Request.IsMobileBrowser();
var allowTrack = HttpContext.AllowTrack();
Configuration
Optional application-wide rate limiting
<a name="optional-application-wide-rate-limiting"></a>
Register the optional middleware in your startup and explicitly enable it in configuration.
It is disabled by default; existing LimitPerMin attributes keep their per-path behavior.
// ConfigureServices:
services.AddMacroRateLimiting(options => configuration.GetSection("MacroRateLimit").Bind(options));
// Configure: after forwarded headers and static files, before routing, authentication and controllers.
app.UseStaticFiles();
app.UseMacroRateLimiting();
app.UseRouting();
{
"MacroRateLimit": {
"Enabled": true,
"PermitLimit": 300,
"WindowSeconds": 60,
"PerIpConcurrencyLimit": 4,
"ConcurrencyLimit": 32
}
}
Each client IP shares its request budget across all URLs reaching the middleware. Separate limits
cap simultaneous requests per IP and per application process; excess requests receive 429 with
Retry-After, without queuing or executing controllers. It uses the validated RemoteIpAddress;
configure trusted proxies appropriately. Limits are per process, not shared between replicas or
applications. Configuration changes take effect after restarting the application.
Development
Install the .NET 10 SDK.
From the repository root, restore, build and test:
dotnet restore Aiursoft.WebTools.sln
dotnet build Aiursoft.WebTools.sln --no-restore
dotnet test Aiursoft.WebTools.sln --no-restore
Run ./lint.sh for the existing static checks.
How to contribute
<a name="how-to-contribute"></a>
There are many ways to contribute to the project: logging bugs, submitting pull requests, reporting issues, and creating suggestions.
Even if you have push rights on the repository, you should create a personal fork and create feature branches there when you need them. This keeps the main repository clean and your workflow cruft out of sight.
We're also interested in your feedback on the future of this project. You can submit a suggestion or feature request through the issue tracker. To make this process more effective, we're asking that these include more information to help define them more clearly.
License
Licensed under the MIT License.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Aiursoft.CSTools (>= 10.0.9)
- Aiursoft.WebTools.Abstractions (>= 10.0.3)
- Net.Codecrete.QrCodeGenerator (>= 3.2.1)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Aiursoft.WebTools:
| Package | Downloads |
|---|---|
|
Aiursoft.AiurEventSyncer.WebExtends
Nuget package of 'WebExtends' provided by Aiursoft |
|
|
Aiursoft.UiStack
Nuget package of 'UiStack' provided by Aiurosft |
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on Aiursoft.WebTools:
| Repository | Stars |
|---|---|
|
AiursoftWeb/Kahla
Kahla is a cross-platform business messaging app. Mirror of https://gitlab.aiursoft.com/aiursoft/kahla
|
| Version | Downloads | Last Updated |
|---|---|---|
| 10.0.24 | 0 | 11/25/2026 |
| 10.0.23 | 75 | 11/23/2026 |
| 10.0.22 | 537 | 11/15/2026 |
| 10.0.21 | 1,406 | 10/26/2026 |
| 10.0.20 | 149 | 10/26/2026 |
| 10.0.19 | 688 | 10/19/2026 |
| 10.0.18 | 177 | 10/19/2026 |
| 10.0.17 | 270 | 10/19/2026 |
| 10.0.16 | 1,722 | 9/8/2026 |
| 10.0.15 | 868 | 8/20/2026 |
| 10.0.14 | 1,556 | 7/31/2026 |
| 10.0.13 | 1,998 | 5/26/2026 |
| 10.0.12 | 337 | 5/15/2026 |
| 10.0.11 | 327 | 5/4/2026 |
| 10.0.10 | 148 | 5/4/2026 |
| 10.0.9 | 733 | 3/26/2026 |
| 10.0.8 | 1,031 | 1/28/2026 |
| 10.0.7 | 518 | 1/18/2026 |
| 10.0.6 | 269 | 1/11/2026 |
| 10.0.4 | 332 | 12/31/2025 |