0

I am investigating using Microsoft Yarp as a simple reverse proxy server. I am very confused between two types, HttpTransformer and RequestTransformer. I just want to take an incoming request and strip off a prefix from the given path and then use my existing service discovery infrastructure to dynamically set the host value of the outbound/proxied request. I am not sure which type I should be using as an extensibility point into my custom logic. The HttpTransformer has this signature:

ValueTask TransformRequestAsync(HttpContext httpContext, HttpRequestMessage proxyRequest, string destinationPrefix, CancellationToken cancellationToken)

The RequestTransformer has this signature:

ValueTask ApplyAsync(RequestTransformContext context)

The documentation is pretty good, but I was not able to determine the differences between these two types and when to use which one. Can someone please tell me the difference between these two types?

Rob L
  • 3,073
  • 6
  • 31
  • 61

0 Answers0