# WithHttpsEndpoint

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

Adds an HTTPS endpoint

## Remarks

If an endpoint with the same name already exists on the resource, the existing endpoint is updated
with any non-null parameter values. Parameters left as `null` will not modify the existing endpoint's values.

## Definition

```go
func (ResourceWithEndpoints) WithHttpsEndpoint(options ...*WithHttpsEndpointOptions) ResourceWithEndpoints
```

## Parameters

- `options` (`...*WithHttpsEndpointOptions`) -- optional settings, see [Options](#options)

## Options

Optional parameters are passed in a trailing `options ...*WithHttpsEndpointOptions` argument.

- `Port` (`*float64`) -- An optional host port.
- `TargetPort` (`*float64`) -- This is the port the resource is listening on. If the endpoint is used for the container, it is the container port.
- `Name` (`*string`) -- An optional name of the endpoint. Defaults to "https" if not specified.
- `Env` (`*string`) -- An optional name of the environment variable to inject.
- `IsProxied` (`*bool`) -- Specifies if the endpoint will be proxied by DCP. Defaults to `null`.

## Returns

[`ResourceWithEndpoints`](/reference/api/go/aspire.hosting/resourcewithendpoints.md) -- The resource builder.

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

## Applies to

- [`CSharpAppResource`](/reference/api/go/aspire.hosting/csharpappresource.md)
- [`ContainerResource`](/reference/api/go/aspire.hosting/containerresource.md)
- [`DotnetToolResource`](/reference/api/go/aspire.hosting/dotnettoolresource.md)
- [`ExecutableResource`](/reference/api/go/aspire.hosting/executableresource.md)
- [`ProjectResource`](/reference/api/go/aspire.hosting/projectresource.md)
