Table of Contents

Class ForwarderHttpClientFactory

Namespace
Yarp.ReverseProxy.Forwarder
Assembly
Yarp.ReverseProxy.dll

Default implementation of IForwarderHttpClientFactory.

public class ForwarderHttpClientFactory : IForwarderHttpClientFactory
Inheritance
ForwarderHttpClientFactory
Implements
Inherited Members

Constructors

ForwarderHttpClientFactory()

Initializes a new instance of the ForwarderHttpClientFactory class.

public ForwarderHttpClientFactory()

ForwarderHttpClientFactory(ILogger<ForwarderHttpClientFactory>)

Initializes a new instance of the ForwarderHttpClientFactory class.

public ForwarderHttpClientFactory(ILogger<ForwarderHttpClientFactory> logger)

Parameters

logger ILogger<ForwarderHttpClientFactory>

Methods

CanReuseOldClient(ForwarderHttpClientContext)

Checks if the options have changed since the old client was created. If not then the old client will be re-used. Re-use can avoid the latency of creating new connections.

protected virtual bool CanReuseOldClient(ForwarderHttpClientContext context)

Parameters

context ForwarderHttpClientContext

Returns

bool

ConfigureHandler(ForwarderHttpClientContext, SocketsHttpHandler)

Allows configuring the SocketsHttpHandler instance. The base implementation applies settings from NewConfig. UseProxy, AllowAutoRedirect, AutomaticDecompression, and UseCookies are disabled prior to this call.

protected virtual void ConfigureHandler(ForwarderHttpClientContext context, SocketsHttpHandler handler)

Parameters

context ForwarderHttpClientContext
handler SocketsHttpHandler

CreateClient(ForwarderHttpClientContext)

public HttpMessageInvoker CreateClient(ForwarderHttpClientContext context)

Parameters

context ForwarderHttpClientContext

Returns

HttpMessageInvoker

WrapHandler(ForwarderHttpClientContext, HttpMessageHandler)

Adds any wrapping middleware around the HttpMessageHandler.

protected virtual HttpMessageHandler WrapHandler(ForwarderHttpClientContext context, HttpMessageHandler handler)

Parameters

context ForwarderHttpClientContext
handler HttpMessageHandler

Returns

HttpMessageHandler