# WithHostHttpsPort

- Module: [Aspire.Hosting.Yarp](/reference/api/go/aspire.hosting.yarp.md)
- Version: `17.0.0`
- Kind: `method`
- Defined on: [`YarpResource`](/reference/api/go/aspire.hosting.yarp/yarpresource.md)
- Source: [GitHub](https://github.com/microsoft/aspire/tree/bcfa151cdca6d0a573f22d5d9c23f9c727cb3b2f)

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.

## Definition

```go
func (YarpResource) WithHostHttpsPort(port *float64) YarpResource
```

## Parameters

- `port` (`*float64`) -- The port to bind on the host. If `null` is used random port will be assigned.

## Returns

[`YarpResource`](/reference/api/go/aspire.hosting.yarp/yarpresource.md) -- The updated resource builder.

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

## Applies to

- [`YarpResource`](/reference/api/go/aspire.hosting.yarp/yarpresource.md)
