microsoft / reverse-proxy

A toolkit for developing high-performance HTTP reverse proxy applications.
https://microsoft.github.io/reverse-proxy
MIT License
8.44k stars 829 forks source link

Ocelot DelegatingHandlers Substitute in Yarp #2303

Open SpringHgui opened 10 months ago

SpringHgui commented 10 months ago

What should we add or change to make your life better?

How to use Delegating Handlers in yarp like Ocelot

Why is this important to you?

Tratcher commented 10 months ago

See https://microsoft.github.io/reverse-proxy/articles/http-client-config.html#custom-iforwarderhttpclientfactory

For some customizations you can derive from the default ForwarderHttpClientFactory and override the methods that configure the client.

See https://microsoft.github.io/reverse-proxy/api/Yarp.ReverseProxy.Forwarder.ForwarderHttpClientFactory.html#Yarp_ReverseProxy_Forwarder_ForwarderHttpClientFactory_WrapHandler_Yarp_ReverseProxy_Forwarder_ForwarderHttpClientContext_HttpMessageHandler_

Triage: DelegatingHandlers are a common scenario worth mentioning directly in the doc for easy discovery.