# GatewayListenerV1

- Kind: `class`
- Package: [Aspire.Hosting.Kubernetes](/reference/api/csharp/aspire.hosting.kubernetes.md)
- Version: `13.3.0-preview.1.26254.5`
- Namespace: `Aspire.Hosting.Kubernetes.Resources`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Kubernetes/Resources/GatewayV1.cs)

Represents a listener on a Gateway. A listener defines how the Gateway receives traffic on a specific port and protocol.

## Definition

```csharp
namespace Aspire.Hosting.Kubernetes.Resources;

public sealed class GatewayListenerV1
{
    // ...
}
```

## Constructors

- [GatewayListenerV1](/reference/api/csharp/aspire.hosting.kubernetes/gatewaylistenerv1/constructors.md#constructor)

## Properties

- [AllowedRoutes](/reference/api/csharp/aspire.hosting.kubernetes/gatewaylistenerv1/properties.md#allowedroutes) : [GatewayAllowedRoutesV1?](/reference/api/csharp/aspire.hosting.kubernetes/gatewayallowedroutesv1.md) `get; set` -- Gets or sets the allowed routes configuration for this listener.
- [Hostname](/reference/api/csharp/aspire.hosting.kubernetes/gatewaylistenerv1/properties.md#hostname) : `string?` `get; set` -- Gets or sets the optional hostname for this listener. When set, only requests matching this hostname are handled by this listener.
- [Name](/reference/api/csharp/aspire.hosting.kubernetes/gatewaylistenerv1/properties.md#name) : `string` `get; set` -- Gets or sets the name of this listener. Must be unique within the Gateway.
- [Port](/reference/api/csharp/aspire.hosting.kubernetes/gatewaylistenerv1/properties.md#port) : `int` `get; set` -- Gets or sets the network port for this listener.
- [Protocol](/reference/api/csharp/aspire.hosting.kubernetes/gatewaylistenerv1/properties.md#protocol) : `string` `get; set` -- Gets or sets the protocol for this listener (e.g., `"HTTP"`, `"HTTPS"`, `"TLS"`).
- [Tls](/reference/api/csharp/aspire.hosting.kubernetes/gatewaylistenerv1/properties.md#tls) : [GatewayTlsConfigV1?](/reference/api/csharp/aspire.hosting.kubernetes/gatewaytlsconfigv1.md) `get; set` -- Gets or sets the TLS configuration for this listener. Required when protocol is HTTPS or TLS.
