# Endpoint keys

| Key | Type | Default | Takes effect |
|---|---|---|---|
| [`id`](#id) | id | generated | — |
| [`name`](#name) | string | empty | live |
| [`host`](#host) | host | **required** | live |
| [`port`](#port) | int | **required** | live |
| [`weight`](#weight) | int | `1` | live |
| [`state`](#state) | enum | `enabled` | live |
| [`max_connections`](#max_connections) | int | `0` | live |
| [`proxy_protocol`](#proxy_protocol) | enum | `none` | live |
| [`backend_tls`](#backend_tls) | bool | `false` | live |
| [`backend_tls_pin`](#backend_tls_pin) | string | empty | live |
| [`probe`](#probe) | enum | `tcp` | live |
| [`ping_interval`](#ping_interval) | int | `10` | live |
| [`probe_timeout`](#probe_timeout) | int | `5` | live |
| [`probe_url`](#probe_url) | url | empty | live |
| [`probe_user`](#probe_user) | string | empty | live |
| [`probe_password`](#probe_password) | secret | empty | live |
| [`location`](#location) | latlon | empty | live |
| [`ip_rules`](#ip_rules) | list | empty list | live |

### `id`

Stable identity, unique in the file.

- **Where:** `prefs/listeners/listeners_subitem/endpoints/endpoints_subitem/id`, in each endpoint
- **Type:** `id`
- **Default:** generated when missing
- **Applies:** always
- **Takes effect:** — (not a setting that changes)
- **Flags:** generated when missing
- **UI:** Header › Id: Stable identity of the endpoint, unique in the file and generated when missing.

### `name`

Display name and map label.

- **Where:** `prefs/listeners/listeners_subitem/endpoints/endpoints_subitem/name`, in each endpoint
- **Type:** `string`, at most 64 characters
- **Default:** empty (shown as `host:port`)
- **Applies:** always
- **Takes effect:** live, when saved or loaded (no restart)
- **Flags:** none
- **UI:** Target › Name: Display name and map label. Empty shows the host and port.

### `host`

Backend host. Names are resolved off the data path every 60 s; the last good address is kept.

- **Where:** `prefs/listeners/listeners_subitem/endpoints/endpoints_subitem/host`, in each endpoint
- **Type:** `host`
- **Default:** none: the key is required
- **Applies:** always
- **Takes effect:** live, when saved or loaded (no restart)
- **Flags:** required: a missing value is ERROR REQUIRED on its object
- **UI:** Target › Host: Backend IP address or DNS name. Names are resolved every 60 seconds.

### `port`

Backend port. On a range listener, the backend port for the first port of the range; `port + (B − A)` must be ≤ 65535 (BAD_VALUE).

- **Where:** `prefs/listeners/listeners_subitem/endpoints/endpoints_subitem/port`, in each endpoint
- **Type:** `int`, 1–65,535
- **Default:** none: the key is required
- **Applies:** always
- **Takes effect:** live, when saved or loaded (no restart)
- **Flags:** required: a missing value is ERROR REQUIRED on its object
- **UI:** Target › Port: Backend port. On a port range, the backend port for the first port of the range.

### `weight`

Relative share of new connections; higher means more.

- **Where:** `prefs/listeners/listeners_subitem/endpoints/endpoints_subitem/weight`, in each endpoint
- **Type:** `int`, 1–1000
- **Default:** `1`
- **Applies:** always
- **Takes effect:** live, when saved or loaded (no restart)
- **Flags:** none
- **UI:** Traffic › Weight: Relative share of new connections; higher means more.

### `state`

`draining`: only pinned (sticky) traffic. `disabled`: no new traffic. Open sessions are never cut. Persisted by the UI's Drain, Enable and Disable actions.

- **Where:** `prefs/listeners/listeners_subitem/endpoints/endpoints_subitem/state`, in each endpoint
- **Type:** `enum`: `enabled`, `draining` or `disabled`
- **Default:** `enabled`
- **Applies:** always
- **Takes effect:** live, when saved or loaded (no restart)
- **Flags:** none
- **UI:** Header › State: enabled takes new traffic, draining only pinned traffic, and disabled none. Open sessions are never cut.

### `max_connections`

Concurrent sessions to this endpoint, enforced exactly. A full endpoint is skipped.

- **Where:** `prefs/listeners/listeners_subitem/endpoints/endpoints_subitem/max_connections`, in each endpoint
- **Type:** `int`, 0–10,000,000 (0 = unlimited)
- **Default:** `0` = unlimited
- **Applies:** always
- **Takes effect:** live, when saved or loaded (no restart)
- **Flags:** none
- **UI:** Traffic › Max connections: Concurrent sessions to this endpoint; 0 = unlimited. A full endpoint is skipped.

### `proxy_protocol`

PROXY header sent as the first bytes of every backend connection, spec-correct, without TLVs. It must match the CrushMFT port's `proxy_header` or `proxy_header_v2` setting. For FTP passive ranges, CrushMFT also needs `proxy_protocol_ftp_pasv=true`.

- **Where:** `prefs/listeners/listeners_subitem/endpoints/endpoints_subitem/proxy_protocol`, in each endpoint
- **Type:** `enum`: `none`, `v1` or `v2`
- **Default:** `none`
- **Applies:** always
- **Takes effect:** live, when saved or loaded (no restart)
- **Flags:** none
- **UI:** PROXY › PROXY header: PROXY header sent first on every backend connection. It must match the PROXY setting of the CrushMFT port.

### `backend_tls`

`true`: connect to this endpoint with TLS (the balancer re-encrypts). Applies on `tls`, `http` and `https` listeners. On a `tcp` listener, including range listeners, it does not apply, because `tcp` relays the client's bytes unchanged: it is kept but not parsed (only INFO KEY_NOT_APPLICABLE), and its effective value (`EndpointConfig.backendTls()`) is false. Use `tcp` mode for end-to-end client TLS. The PROXY header, when configured, is sent before the TLS handshake, as CrushMFT expects. TLSv1.3 and TLSv1.2; SNI is `host` when it is a DNS name. Without `backend_tls_pin` the backend certificate must verify against the JDK trust store with an HTTPS hostname check against `host`. Any failure during the back-leg handshake (a handshake error, a reset, or no completed handshake within 10 s) is the connect failure BACKEND_TLS: the next endpoint is tried and passive health is charged; when the last allowed attempt fails this way, the session closes as CONNECT_FAILED. The one exception is a handshake refused because the TLS task queue is full: OVERLOADED, not retried, not charged, and the session ends with a reset (RESOURCE); in `http` and `https` mode too, so no `503` is sent. Such an endpoint is never connected in plain. The engine takes plain or TLS from the endpoint as it was routed (`EndpointRuntime.backendTls()`), so an endpoint that a reload removed between routing and connect fails at once as BACKEND_TLS. If no client TLS context can be built (an unloadable JDK trust store), every handshake fails at once as BACKEND_TLS, with one TLS ERROR per endpoint.

- **Where:** `prefs/listeners/listeners_subitem/endpoints/endpoints_subitem/backend_tls`, in each endpoint
- **Type:** `bool`
- **Default:** `false`
- **Applies:** when the listener's `mode` is `tls`, `http` or `https`
- **Takes effect:** live, when saved or loaded (no restart)
- **Flags:** none
- **UI:** Backend TLS › Connect to the backend with TLS: Re-encrypts the traffic to this endpoint, for a CrushMFT HTTPS port. Applies on tls, http and https listeners.

### `backend_tls_pin`

SHA-256 fingerprint of the endpoint's leaf certificate: 64 hex digits, with or without `:` separators, any case; saved as upper-case byte pairs separated by `:`. When set, the backend's leaf certificate must have exactly this fingerprint, and the chain, dates and host name are not checked (for CrushMFT's self-signed certificates). The UI's "Trust this certificate" action fills it from the backend certificate check (route #36). Applies only while `backend_tls=true` applies: otherwise (`backend_tls=false`, or an endpoint of a `tcp` listener) it is kept but not parsed, with only INFO KEY_NOT_APPLICABLE; its effective value (`EndpointConfig.backendTlsPin()`) is `""`, and route #36 answers 409 `state_conflict` ("backend_tls does not apply: backend_tls=false, or an endpoint of a tcp listener"). Malformed while it applies: ERROR BAD_VALUE.

- **Where:** `prefs/listeners/listeners_subitem/endpoints/endpoints_subitem/backend_tls_pin`, in each endpoint
- **Type:** `string`, at most 95 characters
- **Default:** empty = verify with the JDK trust store and a hostname check
- **Applies:** when the listener's `mode` is `tls`, `http` or `https` and `backend_tls` is `true`
- **Takes effect:** live, when saved or loaded (no restart)
- **Flags:** none
- **UI:** Backend TLS › Pinned certificate (SHA-256): SHA-256 fingerprint of the backend certificate; when set, only that certificate is accepted. Empty verifies the certificate with the Java trust store and the host name.

### `probe`

Active health check. See "Probe types" below this table.

- **Where:** `prefs/listeners/listeners_subitem/endpoints/endpoints_subitem/probe`, in each endpoint
- **Type:** `enum`: `tcp`, `http`, `crushftp` or `none`
- **Default:** `tcp` (`none` on range listeners)
- **Applies:** always
- **Takes effect:** live, when saved or loaded (no restart)
- **Flags:** none
- **UI:** Health check › Probe: Active health check: tcp connects, http requests the probe URL, crushftp logs in and reads CrushMFT metrics, and none relies on failed connections only.

### `ping_interval`

Probe period.

- **Where:** `prefs/listeners/listeners_subitem/endpoints/endpoints_subitem/ping_interval`, in each endpoint
- **Type:** `int`, in seconds, 1–3600
- **Default:** `10`
- **Applies:** always
- **Takes effect:** live, when saved or loaded (no restart)
- **Flags:** none
- **UI:** Health check › Probe interval: Seconds between two health checks.

### `probe_timeout`

Limit for one probe run: connect plus exchange. For `crushftp` it covers login plus scrape.

- **Where:** `prefs/listeners/listeners_subitem/endpoints/endpoints_subitem/probe_timeout`, in each endpoint
- **Type:** `int`, in seconds, 1–60
- **Default:** `5`
- **Applies:** always
- **Takes effect:** live, when saved or loaded (no restart)
- **Flags:** none
- **UI:** Health check › Probe timeout: Seconds one health check may take, connect and exchange included.

### `probe_url`

See "Probe URL" below this table.

- **Where:** `prefs/listeners/listeners_subitem/endpoints/endpoints_subitem/probe_url`, in each endpoint
- **Type:** `url`
- **Default:** empty
- **Applies:** when `probe` is `http` or `crushftp`
- **Takes effect:** live, when saved or loaded (no restart)
- **Flags:** none
- **UI:** Health check › Probe URL: For http, the URL to request; empty requests the endpoint's own address. For crushftp, the base URL of a CrushMFT web port, which is required.

### `probe_user`

CrushMFT user for `probe=crushftp`. It needs the SERVER_VIEW or SERVER_EDIT admin role, and the backend must be Enterprise-licensed.

- **Where:** `prefs/listeners/listeners_subitem/endpoints/endpoints_subitem/probe_user`, in each endpoint
- **Type:** `string`, at most 128 characters
- **Default:** empty
- **Applies:** when `probe` is `crushftp`
- **Takes effect:** live, when saved or loaded (no restart)
- **Flags:** none
- **UI:** Health check › Probe user: CrushMFT user for the crushftp probe, with the SERVER_VIEW or SERVER_EDIT admin role.

### `probe_password`

Password of `probe_user`.

- **Where:** `prefs/listeners/listeners_subitem/endpoints/endpoints_subitem/probe_password`, in each endpoint
- **Type:** `secret`
- **Default:** empty
- **Applies:** when `probe` is `crushftp`
- **Takes effect:** live, when saved or loaded (no restart)
- **Flags:** secret: stored encrypted (`enc:`), never returned by the admin API
- **UI:** Health check › Probe password: Password of the probe user. Stored encrypted.

### `location`

Map position override.

- **Where:** `prefs/listeners/listeners_subitem/endpoints/endpoints_subitem/location`, in each endpoint
- **Type:** `latlon`
- **Default:** empty = GeoIP lookup of `host` for public addresses; otherwise drawn at the balancer
- **Applies:** always
- **Takes effect:** live, when saved or loaded (no restart)
- **Flags:** none
- **UI:** Map location › Map location: Position of the endpoint on the map, as lat,lon. Empty looks up a public host; otherwise it is drawn at the balancer.

### `ip_rules`

Clients this endpoint may serve. An endpoint that denies the client is removed from the candidates before balancing.

- **Where:** `prefs/listeners/listeners_subitem/endpoints/endpoints_subitem/ip_rules`, in each endpoint
- **Type:** `list` of at most 10,000 [IP rule](Keys-IP-Rules.md) maps
- **Default:** empty list = allow all
- **Applies:** always
- **Takes effect:** live, when saved or loaded (no restart)
- **Flags:** none
- **UI:** Security › Endpoint IP rules: Clients this endpoint may serve; an endpoint that denies a client is skipped for it. An empty list allows everyone.

### Notes on the endpoint keys

**Probe types:**
- `tcp`: connect. On a `backend_tls` endpoint it also completes the TLS handshake with the endpoint's trust settings.
- `http`: GET `probe_url`; a status of 200–399 means up.
- `crushftp`: log in at `probe_url` as `probe_user` and read CrushMFT's metrics. This also feeds `algorithm=metric`.
- `none`: passive failure detection only.

**Probe URL:**
- **`http`:** the URL to GET. `""` means `http://<host>:<port>/`, or `https://<host>:<port>/` on a `backend_tls` endpoint.
- **`crushftp`:** the base URL of a CrushMFT web port, for example `http://10.0.0.5:8080/`.
  - It is required. When it is missing: on save, ERROR PROBE_URL_REQUIRED; on load, WARN and the endpoint is probed with `tcp` (`none` on a range listener).
- **Userinfo in the URL** gives ERROR PROBE_URL_USERINFO while `probe_url` applies (`probe` is `http` or `crushftp`). Use `probe_user` and `probe_password` instead. With any other `probe` the URL is not parsed and gets only INFO KEY_NOT_APPLICABLE.

**Probe TLS trust:**
- **On a `backend_tls` endpoint,** an `http` or `crushftp` probe whose URL is `https://` on the endpoint's own host and port is verified with the endpoint's trust settings: exactly the `backend_tls_pin` leaf, or the JDK trust store with a hostname check.
  - "On the endpoint's own host and port" means: the URL's port equals the endpoint `port`, and its host resolves through the DNS cache to the endpoint's address. Host names are not compared as text. The same test decides PROXY on probes.
  - Such a probe names the endpoint `host` for SNI and the HTTPS host-name check, as a real back leg does, even when the URL names the endpoint's address by another name. The URL host still goes into the `Host` header and the request line.
  - Failing the endpoint's own trust settings is DOWN for every probe type, with the message "certificate not trusted (SHA-256 …)", because real connections would fail the same way.
  - So a pinned self-signed CrushMFT can be logged in to and its metrics read.
- **Every other `https` URL**, including a URL on the endpoint's own host and port when the endpoint has no `backend_tls`, is verified against the JDK trust store with a hostname check against the URL's own host. If verification fails, the probe counts as "up, with warning" and no credentials are sent.
