Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

WithMatchHosts

Method
📦 Aspire.Hosting.Yarp v17.0.0
func (YarpRoute) WithMatchHosts(hosts []string) YarpRoute

Signature

methodWithMatchHosts
Only match requests with the given Host header. Supports wildcards and ports. For unicode host names, do not use punycode.
WithMatchHosts(hosts []string) YarpRoute
hosts[]string
YarpRoute

Returns a handle; failures surface later via Err().

Applies to

This method applies to the following types: