Releases: twitchax/AspNetCore.Proxy
AspNetCore.Proxy 4.5.0
Available on NuGet.
What's Changed
- Add example to route all unhandled requests by @dahlbyk in #92
- Proxy Http Reason Phrase to Avoid Unconscious Incompatibilities. by @xinlifoobar in #106
New Contributors
- @dahlbyk made their first contribution in #92
- @xinlifoobar made their first contribution in #106
Full Changelog: v4.4.0...v4.5.0
AspNetCore.Proxy 4.4.0
Available on NuGet.
This release adds net6.0
support, and fixes a UTF-8 encoding issue with multipart
form data in Content-Disposition
.
What's Changed
- add dotnet 6 support by @YusufMavzer in #93
- Modify http multipart test to check proper non-ascii file name treating (fix #95) by @saliksaly in #96
New Contributors
- @YusufMavzer made their first contribution in #93
- @saliksaly made their first contribution in #96
Full Changelog: v4.3.0...v4.4.0
AspNetCore.Proxy 4.3.0
Available on NuGet.
This release adds extension methods on HttpContext
to make proxying from within a "minimal API" handler more idiomatic.
Full Changelog: v4.2.2...v4.3.0
AspNetCore.Proxy 4.2.2
Available on NuGet.
This release uses more efficient handling of large message sizes when proxying web socket messages (as opposed to using a large static buffer size).
What's Changed
- README.md fix Uber example code by @ka-zsolt in #86
- Fix buffer handling for large WebSocket messages by @brnbs in #88
New Contributors
Full Changelog: v4.2.1...v4.2.2
AspNetCore.Proxy 4.2.1
Available on NuGet.
This release fixes an issue when RouteData
could be null
.
AspNetCore.Proxy 4.2.0
AspNetCore.Proxy 4.1.0
Available on NuGet.
This release adds support for proxying x-www-form-urlencoded
and multipart/form-data
.
Special thanks to @PreferLinux for the PR (#61).
AspNetCore.Proxy 4.0.1
Available on NuGet.
Breaking Changes
This release makes a few breaking changes.
Static Method Attributes Removed
You can no longer proxy using the static method attributes. The feature was not widely used, and using the extension methods on a controller makes this same pattern much easier.
[ProxyRoute("api/posts/{arg1}/{arg2}")]
public static async Task<string> GetProxy(string arg1, string arg2)
Builder Pattern
The builder pattern used throughout this library now more closely matches ASP.NET Core builder patterns. For example, UseProxies
now looks like this.
app.UseProxies(proxies =>
{
// Bare string.
proxies.Map("echo/post", proxy => proxy.UseHttp("https://postman-echo.com/post"));
// Computed to task.
proxies.Map("api/comments/task/{postId}", proxy => proxy.UseHttp((_, args) => new ValueTask<string>($"https://jsonplaceholder.typicode.com/comments/{args["postId"]}")));
// Computed to string.
proxies.Map("api/comments/string/{postId}", proxy => proxy.UseHttp((_, args) => $"https://jsonplaceholder.typicode.com/comments/{args["postId"]}"));
});
In addition, option builders can call Build
to build the concrete types.
private HttpProxyOptions _httpOptions = HttpProxyOptionsBuilder.Instance
.WithShouldAddForwardedHeaders(false)
.Build();
Features
This release adds a few features.
WebSocket Options
The WebSocket proxies now support options.
private WsProxyOptions _wsOptions = WsProxyOptionsBuilder.Instance
.WithBufferSize(8192)
.WithIntercept(context => new ValueTask<bool>(context.WebSockets.WebSocketRequestedProtocols.Contains("interceptedProtocol")))
.WithBeforeConnect((context, wso) =>
{
wso.AddSubProtocol("myRandomProto");
return Task.CompletedTask;
})
.WithHandleFailure(async (context, e) =>
{
context.Response.StatusCode = 599;
await context.Response.WriteAsync("Failure handled.");
}).Build();
AspNetCore.Proxy 4.0.0-alpha
Available on NuGet.
AspNetCore.Proxy 3.1.1
Drop Microsoft.Extensions.Http
version.