Table of Contents

Class HttpContextFeaturesExtensions

Namespace
Microsoft.AspNetCore.Http
Assembly
Yarp.ReverseProxy.dll

Extension methods for fetching proxy configuration from the current HttpContext.

public static class HttpContextFeaturesExtensions
Inheritance
HttpContextFeaturesExtensions
Inherited Members

Methods

GetForwarderErrorFeature(HttpContext)

Retrieves the IForwarderErrorFeature instance associated with the current request, if any.

public static IForwarderErrorFeature? GetForwarderErrorFeature(this HttpContext context)

Parameters

context HttpContext

Returns

IForwarderErrorFeature

GetReverseProxyFeature(HttpContext)

Retrieves the IReverseProxyFeature instance associated with the current request.

public static IReverseProxyFeature GetReverseProxyFeature(this HttpContext context)

Parameters

context HttpContext

Returns

IReverseProxyFeature

GetRouteModel(HttpContext)

Retrieves the RouteModel instance associated with the current request.

public static RouteModel GetRouteModel(this HttpContext context)

Parameters

context HttpContext

Returns

RouteModel

ReassignProxyRequest(HttpContext, ClusterState)

Replaces the assigned cluster and destinations in IReverseProxyFeature with the new ClusterState, causing the request to be sent to the new cluster instead.

public static void ReassignProxyRequest(this HttpContext context, ClusterState cluster)

Parameters

context HttpContext
cluster ClusterState

ReassignProxyRequest(HttpContext, RouteModel, ClusterState)

Replaces the assigned route, cluster, and destinations in IReverseProxyFeature with the new RouteModel and new ClusterState, causing the request to be sent using the new route to the new cluster.

public static void ReassignProxyRequest(this HttpContext context, RouteModel route, ClusterState cluster)

Parameters

context HttpContext
route RouteModel
cluster ClusterState