# Aspire.Hosting.Yarp

- Module: `Aspire.Hosting.Yarp`
- Version: `13.6.0`
- Source: [GitHub](https://github.com/microsoft/aspire/tree/f4c27f2d43ddc1cacd0dd083b30d1fea1cee7a62)
- Functions: `55`
- Types: `16`

## Types

- [IYarpConfigurationBuilder](/reference/api/typescript/aspire.hosting.yarp/iyarpconfigurationbuilder.md) -- `interface` - 7 members -- Interface to build a configuration file for YARP
- [YarpActiveHealthCheckConfig](/reference/api/typescript/aspire.hosting.yarp/yarpactivehealthcheckconfig.md) -- `type` - 6 fields -- Represents active health check configuration for a YARP cluster.
- [YarpCluster](/reference/api/typescript/aspire.hosting.yarp/yarpcluster.md) -- `handle` - 6 members -- Represents a cluster for YARP routes
- [YarpForwarderRequestConfig](/reference/api/typescript/aspire.hosting.yarp/yarpforwarderrequestconfig.md) -- `type` - 4 fields -- Represents forwarder request configuration for a YARP cluster.
- [YarpHealthCheckConfig](/reference/api/typescript/aspire.hosting.yarp/yarphealthcheckconfig.md) -- `type` - 3 fields -- Represents health check configuration for a YARP cluster.
- [YarpHttpClientConfig](/reference/api/typescript/aspire.hosting.yarp/yarphttpclientconfig.md) -- `type` - 7 fields -- Represents HTTP client configuration for a YARP cluster.
- [YarpPassiveHealthCheckConfig](/reference/api/typescript/aspire.hosting.yarp/yarppassivehealthcheckconfig.md) -- `type` - 3 fields -- Represents passive health check configuration for a YARP cluster.
- [YarpResource](/reference/api/typescript/aspire.hosting.yarp/yarpresource.md) -- `handle` - 5 members
- [YarpRoute](/reference/api/typescript/aspire.hosting.yarp/yarproute.md) -- `handle` - 36 members -- Represents a route for YARP
- [YarpRouteHeaderMatch](/reference/api/typescript/aspire.hosting.yarp/yarprouteheadermatch.md) -- `type` - 4 fields -- Represents a header-based route match for a YARP route.
- [YarpRouteMatch](/reference/api/typescript/aspire.hosting.yarp/yarproutematch.md) -- `type` - 5 fields -- Represents route match criteria for a YARP route.
- [YarpRouteQueryParameterMatch](/reference/api/typescript/aspire.hosting.yarp/yarproutequeryparametermatch.md) -- `type` - 4 fields -- Represents a query-parameter-based route match for a YARP route.
- [YarpSessionAffinityConfig](/reference/api/typescript/aspire.hosting.yarp/yarpsessionaffinityconfig.md) -- `type` - 5 fields -- Represents session affinity configuration for a YARP cluster.
- [YarpSessionAffinityCookieConfig](/reference/api/typescript/aspire.hosting.yarp/yarpsessionaffinitycookieconfig.md) -- `type` - 8 fields -- Represents session affinity cookie configuration for a YARP cluster.
- [YarpWebProxyConfig](/reference/api/typescript/aspire.hosting.yarp/yarpwebproxyconfig.md) -- `type` - 3 fields -- Represents web proxy configuration for a YARP cluster.

## Functions

- [addCatchAllRoute](/reference/api/typescript/aspire.hosting.yarp/addcatchallroute.md) -- `method` -- Adds a catch-all route for a cluster, endpoint, resource, or string destination target.
- [addClusterFromEndpoint](/reference/api/typescript/aspire.hosting.yarp/addclusterfromendpoint.md) -- `method` -- Adds a cluster for an endpoint reference.
- [addClusterFromExternalService](/reference/api/typescript/aspire.hosting.yarp/addclusterfromexternalservice.md) -- `method` -- Adds a cluster for an external service resource.
- [addClusterFromResource](/reference/api/typescript/aspire.hosting.yarp/addclusterfromresource.md) -- `method` -- Adds a cluster for a resource that supports service discovery.
- [addClusterWithDestination](/reference/api/typescript/aspire.hosting.yarp/addclusterwithdestination.md) -- `method` -- Adds a cluster from a single destination.
- [addClusterWithDestinations](/reference/api/typescript/aspire.hosting.yarp/addclusterwithdestinations.md) -- `method` -- Adds a cluster from multiple destinations.
- [addRoute](/reference/api/typescript/aspire.hosting.yarp/addroute.md) -- `method` -- Adds a route for a cluster, endpoint, resource, or string destination target.
- [addYarp](/reference/api/typescript/aspire.hosting.yarp/addyarp.md) -- `method` -- Adds a YARP container to the application model.
- [publishWithStaticFiles](/reference/api/typescript/aspire.hosting.yarp/publishwithstaticfiles.md) -- `method` -- In publish mode, generates a Dockerfile that copies static files from the specified resource into /app/wwwroot.
- [withConfiguration](/reference/api/typescript/aspire.hosting.yarp/withconfiguration.md) -- `method` -- Configure the YARP resource.
- [withForwarderRequestConfig](/reference/api/typescript/aspire.hosting.yarp/withforwarderrequestconfig.md) -- `method` -- Set the forwarder request configuration for the cluster.
- [withHealthCheckConfig](/reference/api/typescript/aspire.hosting.yarp/withhealthcheckconfig.md) -- `method` -- Set the health check configuration for the cluster.
- [withHostHttpsPort](/reference/api/typescript/aspire.hosting.yarp/withhosthttpsport.md) -- `method` -- Configures the host HTTPS port that the YARP resource is exposed on instead of using randomly assigned port. This will only have effect if an HTTPS endpoint is configured on the YARP resource due to TLS termination being enabled.
- [withHostPort](/reference/api/typescript/aspire.hosting.yarp/withhostport.md) -- `method` -- Configures the host port that the YARP resource is exposed on instead of using randomly assigned port.
- [withHttpClientConfig](/reference/api/typescript/aspire.hosting.yarp/withhttpclientconfig.md) -- `method` -- Set the HTTP client configuration for the cluster.
- [withLoadBalancingPolicy](/reference/api/typescript/aspire.hosting.yarp/withloadbalancingpolicy.md) -- `method` -- Set the LoadBalancingPolicy for the cluster.
- [withMatch](/reference/api/typescript/aspire.hosting.yarp/withmatch.md) -- `method` -- Set the parameters used to match requests.
- [withMatchHeaders](/reference/api/typescript/aspire.hosting.yarp/withmatchheaders.md) -- `method` -- Only match requests that contain all of these headers.
- [withMatchHosts](/reference/api/typescript/aspire.hosting.yarp/withmatchhosts.md) -- `method` -- Only match requests with the given Host header. Supports wildcards and ports. For unicode host names, do not use punycode.
- [withMatchMethods](/reference/api/typescript/aspire.hosting.yarp/withmatchmethods.md) -- `method` -- Only match requests that use these optional HTTP methods. E.g. GET, POST.
- [withMatchPath](/reference/api/typescript/aspire.hosting.yarp/withmatchpath.md) -- `method` -- Only match requests with the given Path pattern.
- [withMatchRouteQueryParameter](/reference/api/typescript/aspire.hosting.yarp/withmatchroutequeryparameter.md) -- `method` -- Only match requests that contain all of these query parameters.
- [withMaxRequestBodySize](/reference/api/typescript/aspire.hosting.yarp/withmaxrequestbodysize.md) -- `method` -- Set the MaxRequestBodySize for the destination
- [withMetadata](/reference/api/typescript/aspire.hosting.yarp/withmetadata-aspire-hosting-yarp-yarpcluster-dict-string-string.md) -- `method` -- Set the Metadata for the cluster.
- [withMetadata](/reference/api/typescript/aspire.hosting.yarp/withmetadata-aspire-hosting-yarp-yarproute-dict-string-string.md) -- `method` -- Set the Metadata of the destination
- [withOrder](/reference/api/typescript/aspire.hosting.yarp/withorder.md) -- `method` -- Set the order for the destination
- [withSessionAffinityConfig](/reference/api/typescript/aspire.hosting.yarp/withsessionaffinityconfig.md) -- `method` -- Set the session affinity configuration for the cluster.
- [withStaticFiles](/reference/api/typescript/aspire.hosting.yarp/withstaticfiles.md) -- `method` -- Enables static file serving in the YARP resource.
- [withTransform](/reference/api/typescript/aspire.hosting.yarp/withtransform.md) -- `method` -- Add a new transform to the destination.
- [withTransformClientCertHeader](/reference/api/typescript/aspire.hosting.yarp/withtransformclientcertheader.md) -- `method` -- Adds the transform which will set the given header with the Base64 encoded client certificate.
- [withTransformCopyRequestHeaders](/reference/api/typescript/aspire.hosting.yarp/withtransformcopyrequestheaders.md) -- `method` -- Adds the transform which will enable or suppress copying request headers to the proxy request.
- [withTransformCopyResponseHeaders](/reference/api/typescript/aspire.hosting.yarp/withtransformcopyresponseheaders.md) -- `method` -- Adds the transform which will enable or suppress copying response headers to the client response.
- [withTransformCopyResponseTrailers](/reference/api/typescript/aspire.hosting.yarp/withtransformcopyresponsetrailers.md) -- `method` -- Adds the transform which will enable or suppress copying response trailers to the client response.
- [withTransformForwarded](/reference/api/typescript/aspire.hosting.yarp/withtransformforwarded.md) -- `method` -- Adds the transform which will add the Forwarded header as defined by [RFC 7239](https://tools.ietf.org/html/rfc7239).
- [withTransformHttpMethodChange](/reference/api/typescript/aspire.hosting.yarp/withtransformhttpmethodchange.md) -- `method` -- Adds the transform that will replace the HTTP method if it matches.
- [withTransformPathPrefix](/reference/api/typescript/aspire.hosting.yarp/withtransformpathprefix.md) -- `method` -- Adds the transform which will prefix the request path with the given value.
- [withTransformPathRemovePrefix](/reference/api/typescript/aspire.hosting.yarp/withtransformpathremoveprefix.md) -- `method` -- Adds the transform which will remove the matching prefix from the request path.
- [withTransformPathRouteValues](/reference/api/typescript/aspire.hosting.yarp/withtransformpathroutevalues.md) -- `method` -- Adds the transform which will set the request path with route values.
- [withTransformPathSet](/reference/api/typescript/aspire.hosting.yarp/withtransformpathset.md) -- `method` -- Adds the transform which sets the request path with the given value.
- [withTransformQueryRemoveKey](/reference/api/typescript/aspire.hosting.yarp/withtransformqueryremovekey.md) -- `method` -- Adds the transform that will remove the given query key.
- [withTransformQueryRouteValue](/reference/api/typescript/aspire.hosting.yarp/withtransformqueryroutevalue.md) -- `method` -- Adds the transform that will append or set the query parameter from a route value.
- [withTransformQueryValue](/reference/api/typescript/aspire.hosting.yarp/withtransformqueryvalue.md) -- `method` -- Adds the transform that will append or set the query parameter from the given value.
- [withTransformRequestHeader](/reference/api/typescript/aspire.hosting.yarp/withtransformrequestheader.md) -- `method` -- Adds the transform which will append or set the request header.
- [withTransformRequestHeaderRemove](/reference/api/typescript/aspire.hosting.yarp/withtransformrequestheaderremove.md) -- `method` -- Adds the transform which will remove the request header.
- [withTransformRequestHeaderRouteValue](/reference/api/typescript/aspire.hosting.yarp/withtransformrequestheaderroutevalue.md) -- `method` -- Adds the transform which will append or set the request header from a route value.
- [withTransformRequestHeadersAllowed](/reference/api/typescript/aspire.hosting.yarp/withtransformrequestheadersallowed.md) -- `method` -- Adds the transform which will only copy the allowed request headers. Other transforms that modify or append to existing headers may be affected if not included in the allow list.
- [withTransformResponseHeader](/reference/api/typescript/aspire.hosting.yarp/withtransformresponseheader.md) -- `method` -- Adds the transform which will append or set the response header.
- [withTransformResponseHeaderRemove](/reference/api/typescript/aspire.hosting.yarp/withtransformresponseheaderremove.md) -- `method` -- Adds the transform which will remove the response header.
- [withTransformResponseHeadersAllowed](/reference/api/typescript/aspire.hosting.yarp/withtransformresponseheadersallowed.md) -- `method` -- Adds the transform which will only copy the allowed response headers. Other transforms that modify or append to existing headers may be affected if not included in the allow list.
- [withTransformResponseTrailer](/reference/api/typescript/aspire.hosting.yarp/withtransformresponsetrailer.md) -- `method` -- Adds the transform which will append or set the response trailer.
- [withTransformResponseTrailerRemove](/reference/api/typescript/aspire.hosting.yarp/withtransformresponsetrailerremove.md) -- `method` -- Adds the transform which will remove the response trailer.
- [withTransformResponseTrailersAllowed](/reference/api/typescript/aspire.hosting.yarp/withtransformresponsetrailersallowed.md) -- `method` -- Adds the transform which will only copy the allowed response trailers. Other transforms that modify or append to existing trailers may be affected if not included in the allow list.
- [withTransforms](/reference/api/typescript/aspire.hosting.yarp/withtransforms.md) -- `method` -- Set the Transforms of the destination
- [withTransformUseOriginalHostHeader](/reference/api/typescript/aspire.hosting.yarp/withtransformuseoriginalhostheader.md) -- `method` -- Adds the transform which will copy the incoming request Host header to the proxy request.
- [withTransformXForwarded](/reference/api/typescript/aspire.hosting.yarp/withtransformxforwarded.md) -- `method` -- Adds the transform which will add X-Forwarded-* headers.

## Enums

- [YarpSslProtocol](/reference/api/typescript/aspire.hosting.yarp/yarpsslprotocol.md) -- `enum` - 3 values -- Specifies the SSL protocols to enable for a YARP cluster. This enum exists because `SslProtocols` includes obsolete members and values that YARP does not accept.
