This release supports .NET Core 3.1 and .NET 5.0. See Getting Started.
The Yarp.ReverseProxy packages are available on NuGet.org.
Breaking changes
This release contains a number of API breaking changes that aim to make YARP easier and more consistent to use.
- Core types are renamed to better indicate their responsibilities
ClusterConfig=>ClusterModelCluster=>ClusterConfigClusterInfo=>ClusterStateRouteConfig=>RouteModelProxyRoute=>RouteConfigRouteInfo=>RouteStateDestinationConfig=>DestinationModelDestination=>DestinationConfigDestinationInfo=>DestinationState
- Cluster sub option types are also renamed
HealthCheckOptions=>HealthCheckConfigActiveHealthCheckOptions=>ActiveHealthCheckConfigPassiveHealthCheckOptions=>PassiveHealthCheckConfigProxyHttpClientOptions=>ProxyHttpClientConfigWebProxyOptions=>WebProxyConfigRequestProxyOptions=>ForwarderRequestConfigSessionAffinityOptions=>SessionAffinityConfig
- Client certificate configuration is removed from
HttpClientConfig#994- Added configure client certificate sample Details
QueryParameterTransformcan set an empty value "" to a parameter. #978RequestHeaderEncodingis set as a string in configuration #995- Session affinity API changed
- Renamed
ISessionAffinityProvider=>ISessionAffinityPolicy - Renamed
AffinitizeRequest=>AffinitizeResponse - Renamed
SessionAffinityConfig.Mode=>SessionAffinityConfig.Provider - Renamed
AffinityFailurePolicies=>FailurePolicies - New mandatory setting
SessionAffinityConfig.AffinityKeyNameare used by both of cookie and custom header affinity provider to set the cookie name or the custom header name respectively - New strongly-typed section
SessionAffinityCookieConfigis added to configure the cookie affinity provider SessionAffinityConfig.Settingscollection is removed
- Renamed
- Projects structure is refactored by flattening hierarchy and regrouping files, changing several namespaces #1035
- Renamed
IHttpProxy=>IHttpForwarder. In this context, "Forwarder" term is now used instead of "Proxy", thus in all related type the "Proxy" in the name are replaced with "Forwarder" (e.g.IProxyHttpClientFactory=>IForwarderHttpClientFactory,IProxyErrorFeature=>IForwarderErrorFeature,AddHttpProxy=>AddHttpForwarder) - Changed the return type of
IHttpForwarder.SendAsyncit now returnsValueTask<ForwarderError> - Renamed load balancing policy
LoadBalancingPolicies.First=>LoadBalancingPolicies.FirstAlphabetical - Renamed
IActiveHealthCheckMonitor.InitialDestinationsProbed=>InitialProbeCompleted X-Forwarded-*andForwardedheader transforms changed. Details- New transform actions supported: Set, Remove, Off
Prefixconfig setting renamed toHeaderPrefix- Separate action configuration for each of
X-Forwarded-*headers. Example:
{ "X-Forwarded": "Set", "For": "Remove", "Proto": "Append", "Prefix": "Off", "HeaderPrefix": "X-Forwarded-" }- Default action for
X-Forwarded-*andForwardedtransforms is Set
- RequestHeader, ResponseHeader, and ResponseTrailer transforms no longer use
"Set": ""(empty) to remove a header. See the new *Remove transforms below.
Other major changes and features
- Cluster's available destination list is now updated by
IClusterDestinationsUpdaterservice based on destinations health status. Two update policiesHealthyAndUnknownandHealthyOrPanicare added which can be configure on a cluster like this:
"cluster1": {
"AvailableDestinationsPolicy": "HealthyOrPanic",
"HealthCheck": {
"Passive": {
"Enabled": "true"
}
//...
}- New transforms added:
RequestHeaderRemove,ResponseHeaderRemove,ResponseTrailerRemove. Details - Connection specific headers are removed from request and responses #1008, #1050
- User-Agent is for active health check requests #1013
- README.md added for the samples folder
- Documentation for proxying gRPC traffic is added