# HostUrl Constructors

- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Type: [HostUrl](/reference/api/csharp/aspire.hosting/hosturl.md)
- Kind: `Constructors`
- Members: `1`

Represents a URL on the host machine. When referenced in a container resource, localhost will be replaced with the configured container host name.

## HostUrl(string)

- Name: `Constructor(string)`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/HostUrl.cs#L14)

Represents a URL on the host machine. When referenced in a container resource, localhost will be replaced with the configured container host name.

```csharp
public record HostUrl
{
    public HostUrl(
        string Url)
    {
        // ...
    }
}
```

## Parameters

- `Url` (`string`)
