Class HttpContextFeaturesExtensions
Extension methods for fetching proxy configuration from the current HttpContext.
Inheritance
System.Object
HttpContextFeaturesExtensions
Namespace: Microsoft.AspNetCore.Http
Assembly: Yarp.ReverseProxy.dll
Syntax
public static class HttpContextFeaturesExtensions : object
Methods
| Improve this Doc View SourceGetForwarderErrorFeature(HttpContext)
Retrieves the IForwarderErrorFeature instance associated with the current request, if any.
Declaration
public static IForwarderErrorFeature GetForwarderErrorFeature(this HttpContext context)
Parameters
Type | Name | Description |
---|---|---|
HttpContext | context |
Returns
Type | Description |
---|---|
IForwarderErrorFeature |
GetReverseProxyFeature(HttpContext)
Retrieves the IReverseProxyFeature instance associated with the current request.
Declaration
public static IReverseProxyFeature GetReverseProxyFeature(this HttpContext context)
Parameters
Type | Name | Description |
---|---|---|
HttpContext | context |
Returns
Type | Description |
---|---|
IReverseProxyFeature |
GetRouteModel(HttpContext)
Retrieves the RouteModel instance associated with the current request.
Declaration
public static RouteModel GetRouteModel(this HttpContext context)
Parameters
Type | Name | Description |
---|---|---|
HttpContext | context |
Returns
Type | Description |
---|---|
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.
Declaration
public static void ReassignProxyRequest(this HttpContext context, ClusterState cluster)
Parameters
Type | Name | Description |
---|---|---|
HttpContext | context | |
ClusterState | cluster |
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.
Declaration
public static void ReassignProxyRequest(this HttpContext context, RouteModel route, ClusterState cluster)
Parameters
Type | Name | Description |
---|---|---|
HttpContext | context | |
RouteModel | route | |
ClusterState | cluster |