NewHeap.Platform.AspNet.Proxy
1.1.0
dotnet add package NewHeap.Platform.AspNet.Proxy --version 1.1.0
NuGet\Install-Package NewHeap.Platform.AspNet.Proxy -Version 1.1.0
<PackageReference Include="NewHeap.Platform.AspNet.Proxy" Version="1.1.0" />
<PackageVersion Include="NewHeap.Platform.AspNet.Proxy" Version="1.1.0" />
<PackageReference Include="NewHeap.Platform.AspNet.Proxy" />
paket add NewHeap.Platform.AspNet.Proxy --version 1.1.0
#r "nuget: NewHeap.Platform.AspNet.Proxy, 1.1.0"
#:package NewHeap.Platform.AspNet.Proxy@1.1.0
#addin nuget:?package=NewHeap.Platform.AspNet.Proxy&version=1.1.0
#tool nuget:?package=NewHeap.Platform.AspNet.Proxy&version=1.1.0
NewHeap ASP.NET Proxy
Manage redirects and reverse-proxy rules in ASP.NET Core with a built-in administration panel, SQLite storage and YARP forwarding.
Getting started · Configuration · Usage reference · Runnable demo
Overview
Version one is functionally complete for single-instance deployments with local SQLite storage. See the completion record for accepted scope, implementation choices and future-work boundaries.
- Redirect moved pages using exact paths or regular expressions.
- Forward requests to backend services with path, header and query transforms.
- Create, test and activate rules from the administration panel.
- Protect administration with an account, IP restrictions and login activity.
- Keep rules across restarts without a separate database server.
- Optionally manage rules from another server through a Basic-authenticated API.
Installation
Add the package to your ASP.NET Core application (.NET 10):
dotnet add package NewHeap.Platform.AspNet.Proxy.Sqlite
Register the proxy in Program.cs:
using NewHeap.Platform.AspNet.Proxy;
using NewHeap.Platform.AspNet.Proxy.Sqlite;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddNewHeapProxy(builder.Configuration.GetSection("NewHeapProxy"));
var app = builder.Build();
app.UseNewHeapProxy();
app.Run();
Set the administrator account through your deployment platform's secrets:
NewHeapProxy__Administrator__UserName=administrator
NewHeapProxy__Administrator__Password=<your password>
Host the proxy at the origin root, for example https://proxy.example/, and open
/newheap-proxy to sign in. HTTPS is required outside Development.
The SQLite database is created automatically. Use persistent local storage and run one proxy instance per database file. See storage and backups.
Usage
Redirect a page
Create a redirect in the panel, then choose Test draft and Save and activate.
Source: /old-projects
Destination: /projects
Status: 302
For variable paths, enable Use regular expression:
Source: ^/old-projects/([^?]+)(\?.*)?$
Destination: /projects/$1$2
/old-projects/42?tag=new → /projects/42?tag=new
Regex rules preserve only the query values included in the destination. See redirect matching.
Forward requests to a backend
Open Rewrites, choose Create rewrite, and configure:
Path template: /api/{**rest}
Backend URL: https://backend.example/base/
Path transform: Remove prefix /api
/api/projects/42 → https://backend.example/base/projects/42
Replace the example backend with your service URL. Requests are forwarded without a browser redirect. See rewrites and testing.
Test before activating
Use Test a URL to preview which saved rule handles a request, or Test draft to check unsaved changes. Tests show the matching rule and target without contacting the backend. They do not verify backend availability or responses.
Configuration
The server-to-server management API is off by default. Call
app.MapProxyEndpoints() before app.UseNewHeapProxy() to enable
/newheap-proxy/api. It uses the configured administrator credentials with Basic
authentication and HTTPS, without cookies. See the
API contracts and limits.
API requests do not count as logins. Configuration changes are audited durably in
SQLite and are available through GET /newheap-proxy/api/audit.
Options below belong under NewHeapProxy in appsettings.json.
For environment variables, use __ instead of : and prefix with NewHeapProxy__:
NewHeapProxy__Administrator__SessionDuration=04:00:00
NewHeapProxy__IpAllowlist__Enabled=true
NewHeapProxy__IpAllowlist__Entries__0=192.0.2.10
Restart after changing settings. Durations use hh:mm:ss or d.hh:mm:ss.
All durations, counts and size limits must be positive.
| Option | Default | Explanation |
|---|---|---|
Administrator:UserName |
Empty | Administrator login name; required to sign in. |
Administrator:Password |
Empty | Password supplied through secrets. Use either this or PasswordHash. Requires a new login after every restart. |
Administrator:PasswordHash |
Empty | Alternative ASP.NET Identity password hash. A stable hash and persistent Data Protection keys allow sessions to survive restarts. |
Administrator:CredentialVersion |
Empty | Change to invalidate existing sessions after restarting. |
Administrator:SessionDuration |
08:00:00 |
Maximum administration session duration. |
Administrator:LoginAttemptLimit |
5 |
Login attempts allowed per window, shared across all clients. |
Administrator:LoginAttemptWindow |
00:01:00 |
Time window for the login attempt limit. |
Administrator:ApiAuthenticationFailureLimit |
5 |
Failed API credential checks allowed per window, independent of browser logins. Successful API calls consume no allowance. |
Administrator:ApiAuthenticationFailureWindow |
00:01:00 |
Window for failed API authentication; after exhaustion API authentication returns 429 until reset. |
IpAllowlist:Enabled |
false |
Restrict administration to allowed IPs. An enabled, empty list blocks all access. |
IpAllowlist:Entries |
[] |
Allowed IPv4/IPv6 addresses or CIDR ranges. |
LoginAudit:Retention |
90.00:00:00 |
Retain login activity for 90 days; expired records are cleaned up on login attempts. |
LoginAudit:CleanupBatchSize |
1000 |
Maximum expired login records removed per cleanup. |
LoginAudit:MaximumPageSize |
100 |
Maximum login activity records returned per page. |
AllowedDestinationHosts |
[] |
Allowed rewrite backend hostnames, matched case-insensitively. Empty allows any host. Does not restrict redirects. |
Limits:MaximumChainDepth |
2 |
Maximum local redirect/rewrite steps before HTTP 508. |
Limits:RedirectResolutionTimeoutMilliseconds |
50 |
Redirect evaluation timeout; live requests return HTTP 503 on expiry. Range: 1–2,147,483,646 ms. |
Limits:MaximumRulesPerEngine |
1000 |
Maximum redirects, rewrites and rewrite destination groups, counted separately. |
Limits:MaximumTestRequestBytes |
65536 |
Maximum test input and draft-test request size in bytes (64 KiB). |
Limits:TestTimeout |
00:00:05 |
Preview time limit; maximum 2,147,483,647 ms. |
Sqlite:DatabasePath |
App_Data/newheap-proxy.db |
Database path, relative to the application content root unless absolute. Use persistent local storage outside the webroot. |
Sqlite:BusyTimeout |
00:00:05 |
Database lock wait time, rounded up to seconds; maximum 2,147,483,647 seconds. |
ConfigureYarp(...) (code only) |
None | Customize YARP during registration. Repeated calls replace the callback. |
Documentation
- Usage reference — matching, authentication, testing and activation.
- SQLite storage — database setup, backups and offline seeding.
- Runnable demo — try redirects and rewrites locally.
| 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
- NewHeap.Platform.Common (>= 7.2.0)
- Yarp.ReverseProxy (>= 2.3.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on NewHeap.Platform.AspNet.Proxy:
| Package | Downloads |
|---|---|
|
NewHeap.Platform.AspNet.Proxy.Sqlite
SQLite persistence, startup loading and administration for NewHeap redirects and managed YARP rewrites, with ASP.NET Core proxy composition. |
GitHub repositories
This package is not used by any popular GitHub repositories.