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
contextHttpContext
Returns
GetReverseProxyFeature(HttpContext)
Retrieves the IReverseProxyFeature instance associated with the current request.
public static IReverseProxyFeature GetReverseProxyFeature(this HttpContext context)
Parameters
contextHttpContext
Returns
GetRouteModel(HttpContext)
Retrieves the RouteModel instance associated with the current request.
public static RouteModel GetRouteModel(this HttpContext context)
Parameters
contextHttpContext
Returns
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
contextHttpContextclusterClusterState
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
contextHttpContextrouteRouteModelclusterClusterState