Fhi.ReverseProxyMiddleware 0.0.9

dotnet add package Fhi.ReverseProxyMiddleware --version 0.0.9
                    
NuGet\Install-Package Fhi.ReverseProxyMiddleware -Version 0.0.9
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Fhi.ReverseProxyMiddleware" Version="0.0.9" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Fhi.ReverseProxyMiddleware" Version="0.0.9" />
                    
Directory.Packages.props
<PackageReference Include="Fhi.ReverseProxyMiddleware" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Fhi.ReverseProxyMiddleware --version 0.0.9
                    
#r "nuget: Fhi.ReverseProxyMiddleware, 0.0.9"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Fhi.ReverseProxyMiddleware@0.0.9
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Fhi.ReverseProxyMiddleware&version=0.0.9
                    
Install as a Cake Addin
#tool nuget:?package=Fhi.ReverseProxyMiddleware&version=0.0.9
                    
Install as a Cake Tool

Fhi.ReverseProxyMiddleware

CI NUGET

Handles reverse proxy if you just need to route api-calls through without doing anything more about them

Setup example

Create a new asp.net web minimal api project

dotnet new web -o TodoApi

Add a httpClient in program.cs

builder.Services.AddHttpClient("httpClientName", c =>
{
    c.BaseAddress = new Uri("https://urlToApi");
});

Add this package

dotnet add package fhi.reverseproxymiddleware

Add configuration in appsettings.json. TargetPath will be what you want to reverse proxy; ie if your site is hosted on https://localhost, with the configuration below, all calls to https://localhost/api will be forwarded to the using the httpClient with the specified name. AllowedHttpMethods are the methods you want to reverse proxy, by default all are included

"ReverseProxyOptions": {
    "HttpClientName": "httpClientName",
    "TargetPath": "api",
    "AllowedHttpMethods": "get;post;put",
    "IncludeTargetPath": "true"
  } 

Add options and middleware into program.cs

var reverseProxyOptions = builder.Configuration.GetSection("ReverseProxyOptions").Get<ReverseProxyOptions>()!;
...
app.UseMiddleware<ReverseProxyMiddleware>(Options.Create(reverseProxyOptions));
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.0.9 764 10/28/2024
0.0.8 208 10/25/2024
0.0.7 700 11/2/2023
0.0.6 899 1/4/2023
0.0.5 384 1/4/2023
0.0.4 387 1/3/2023
0.0.3 384 1/3/2023
0.0.2 394 1/3/2023
0.0.1 395 1/3/2023