Skip to main content
Listeners sit inside a bind and describe how agentgateway handles incoming connections on that port. A listener can match traffic by hostname, specify the protocol, configure TLS termination, and group related routes.

Fields

string
A human-readable name for this listener. Used in logs and metrics to identify the listener. Not required, but recommended for complex configurations with multiple listeners.
string
The namespace this listener belongs to. Used when agentgateway is managed by a control plane (XDS) to scope resources. For local configurations, this can generally be omitted.
string
The hostname this listener matches. Incoming requests are matched against this value using the HTTP Host header (or SNI for TLS connections).Accepts wildcard prefixes: "*.example.com" matches api.example.com and admin.example.com, but not example.com.When omitted, the listener matches all hostnames not claimed by another listener on the same port.
string
The protocol to expect on this listener. Accepted values:
  • HTTP — Plain HTTP/1.1 or HTTP/2 cleartext.
  • HTTPS — HTTP over TLS. Requires tls to be configured.
When omitted, agentgateway infers the protocol from the traffic. For MCP and A2A backends, HTTP is the typical choice.
object
TLS configuration for this listener. Required when protocol is HTTPS. Agentgateway terminates TLS and forwards plaintext to the upstream backend.
array
The list of routes this listener forwards traffic to. Routes are evaluated in order; the first match wins.See Routes for the full field reference.

Examples

Plain HTTP listener

HTTPS listener with TLS termination

Mutual TLS (mTLS)

Supply a root CA to require and verify client certificates.

TLS with restricted cipher suites and version

Wildcard hostname matching

Use wildcard hostnames to capture all subdomains with one listener.

Named listeners for observability

Naming listeners makes them easier to identify in logs and distributed traces.

Hostname matching precedence

When multiple listeners exist on the same port, agentgateway selects the most specific match:
  1. Exact hostname match (e.g., api.example.com)
  2. Wildcard prefix match (e.g., *.example.com)
  3. Global wildcard (*) or no hostname specified
If two listeners share the same hostname on the same port, the behavior is undefined. Ensure each listener on a port has a distinct hostname.