Skip to content

Releases: twitchax/AspNetCore.Proxy

AspNetCore.Proxy 4.5.0

07 Mar 22:22
b3f70af
Compare
Choose a tag to compare

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

Full Changelog: v4.4.0...v4.5.0

AspNetCore.Proxy 4.4.0

06 Jun 21:10
Compare
Choose a tag to compare

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

New Contributors

Full Changelog: v4.3.0...v4.4.0

AspNetCore.Proxy 4.3.0

14 Feb 08:57
Compare
Choose a tag to compare

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

21 Jan 00:49
804525f
Compare
Choose a tag to compare

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

  • @ka-zsolt made their first contribution in #86
  • @brnbs made their first contribution in #88

Full Changelog: v4.2.1...v4.2.2

AspNetCore.Proxy 4.2.1

07 Sep 19:26
Compare
Choose a tag to compare

Available on NuGet.

This release fixes an issue when RouteData could be null.

AspNetCore.Proxy 4.2.0

16 Apr 23:52
Compare
Choose a tag to compare

Available on NuGet.

This release adds support for .NET 5.

Special thanks to @baronfel for the PR (#75).

AspNetCore.Proxy 4.1.0

06 Aug 23:57
14dd0f2
Compare
Choose a tag to compare

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

16 Mar 18:45
Compare
Choose a tag to compare

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

28 Feb 06:58
c1b7274
Compare
Choose a tag to compare
Pre-release

Available on NuGet.

AspNetCore.Proxy 3.1.1

14 Nov 22:13
Compare
Choose a tag to compare

Drop Microsoft.Extensions.Http version.