Skip to content

v0.9.1-beta.2

Latest

Choose a tag to compare

@svrooij svrooij released this 18 Aug 10:00

Unobtanium.Web.Proxy is not written in modern C#, using Kestrel (you know the low-level http(s) server after dotnet). With some proxy specifications at hand, I managed to built a WAY less complex http proxy. That is also blazing fast.

During the design of this rewrite I kept the reboot ideas in mind, and I think I ticked all the boxes.

💥 everything changed, your code is definitely broken 💣

Check-out the worker example, to get a feeling for the new api.

In short, you now have 3 points where you can influence the proxy:

  • ShouldDecryptNewConnection where you get the hostname and can decide to passthrough or to intercept the request
  • OnRequest which will be called for each incoming intercepted request. Three options, modify request, generate response or do nothing.
  • OnResponse allows you to change the response from the backend (or do nothing)

There are some interfaces, with default implementations if not implemented yourself. All http traffic is intercepted by default (because it does not really matter). For https traffic you’re able to decide whether or not to intercept the traffic.

Https passthrough will just forward the request as is, without decrypting the ssl stream.

Reboot focus

  • net8.0 only (no support for older versions of .NET!)
  • Support for ILogger See #4
  • Support for diagnostic events using ActivitySource and Activity See #3
  • Using the latest .NET features like Span<T> and Memory<T> to improve performance
  • Update dependencies to the latest versions
  • TLS 1.2 and TLS 1.3 only support
  • Modern Event System: Event-handlers with HttpRequestMessage and HttpResponseMessage, to greatly improve the portability of the library See #6
  • HttpClient as the default client, and using the IHttpClientFactory to handle pooling of the clients
  • Testing, testing, testing!

Full Changelog: v0.9.1-beta.1...v0.9.1-beta.2