Class ForwarderHttpClientFactory
Default implementation of IForwarderHttpClientFactory.
Inheritance
Implements
Namespace: Yarp.ReverseProxy.Forwarder
Assembly: Yarp.ReverseProxy.dll
Syntax
public class ForwarderHttpClientFactory : object, IForwarderHttpClientFactory
Constructors
| Improve this Doc View SourceForwarderHttpClientFactory()
Initializes a new instance of the ForwarderHttpClientFactory class.
Declaration
public ForwarderHttpClientFactory()
ForwarderHttpClientFactory(ILogger<ForwarderHttpClientFactory>)
Initializes a new instance of the ForwarderHttpClientFactory class.
Declaration
public ForwarderHttpClientFactory(ILogger<ForwarderHttpClientFactory> logger)
Parameters
Type | Name | Description |
---|---|---|
ILogger<ForwarderHttpClientFactory> | logger |
Methods
| Improve this Doc View SourceCanReuseOldClient(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.
Declaration
protected virtual bool CanReuseOldClient(ForwarderHttpClientContext context)
Parameters
Type | Name | Description |
---|---|---|
ForwarderHttpClientContext | context |
Returns
Type | Description |
---|---|
System.Boolean |
ConfigureHandler(ForwarderHttpClientContext, SocketsHttpHandler)
Allows configuring the
Declaration
protected virtual void ConfigureHandler(ForwarderHttpClientContext context, SocketsHttpHandler handler)
Parameters
Type | Name | Description |
---|---|---|
ForwarderHttpClientContext | context | |
SocketsHttpHandler | handler |
CreateClient(ForwarderHttpClientContext)
Creates and configures an
Declaration
public HttpMessageInvoker CreateClient(ForwarderHttpClientContext context)
Parameters
Type | Name | Description |
---|---|---|
ForwarderHttpClientContext | context | An ForwarderHttpClientContext carrying old and new cluster configurations. |
Returns
Type | Description |
---|---|
HttpMessageInvoker |
Remarks
A call to CreateClient(ForwarderHttpClientContext) can return either
a new
WrapHandler(ForwarderHttpClientContext, HttpMessageHandler)
Adds any wrapping middleware around the
Declaration
protected virtual HttpMessageHandler WrapHandler(ForwarderHttpClientContext context, HttpMessageHandler handler)
Parameters
Type | Name | Description |
---|---|---|
ForwarderHttpClientContext | context | |
HttpMessageHandler | handler |
Returns
Type | Description |
---|---|
HttpMessageHandler |