# Reference: server.client_address

URL: https://scalws.com/docs/reference/server-client_address/
Source: `docs/reference/schema` in the ScalWS repository

<h3 id="server.client_address.file"><code>server.client_address.file</code></h3>

| | |
|---|---|
| Syntax | `file: <string>` |
| Default | `none` |
| Context | `server.client_address` |
| Reload | applies on reload |

File with `header`, `presets` and `trusted_proxies` (the panel integration writes it), merged when the configuration is loaded: its presets are added to the ones above; its `header` and `trusted_proxies` apply when neither `header` nor `trusted_proxies` is set here, otherwise its `trusted_proxies` are added only when its header (absent: `x-forwarded-for`) is the same as here, and left out with a warning when not. A `-` prefix makes a missing file optional. Relative to the configuration's directory.


<h3 id="server.client_address.forwarded_proto"><code>server.client_address.forwarded_proto</code></h3>

| | |
|---|---|
| Syntax | `forwarded_proto: true \| false` |
| Default | `false` |
| Context | `server.client_address` |
| Reload | applies on reload |

Peers of `server.trusted_proxies` (never presets) report the request's scheme in `X-Forwarded-Proto`: exactly one value `http` or `https`; anything else keeps the listener's. Other peers' `X-Forwarded-Proto` is removed before any handler.


<h3 id="server.client_address.header"><code>server.client_address.header</code></h3>

| | |
|---|---|
| Syntax | `header: x-forwarded-for \| forwarded \| cf-connecting-ip \| x-real-ip \| true-client-ip` |
| Default | `none` |
| Context | `server.client_address` |
| Reload | applies on reload |

Header the peers of `server.trusted_proxies` use (default `x-forwarded-for`). Presets use their vendor's header. A peer outside both groups is the client, whatever it sends.


<h3 id="server.client_address.presets"><code>server.client_address.presets</code></h3>

| | |
|---|---|
| Syntax | `presets: [cloudflare, ...]` |
| Default | `[]` |
| Context | `server.client_address` |
| Reload | applies on reload |

Vendor presets: their networks are trusted peers and report the client in the vendor's header. A peer also in `trusted_proxies` belongs to `trusted_proxies`.


<h3 id="server.client_address.presets_dir"><code>server.client_address.presets_dir</code></h3>

| | |
|---|---|
| Syntax | `presets_dir: <string>` |
| Default | `/var/lib/scalws/presets` |
| Context | `server.client_address` |
| Reload | applies on reload |

Directory with refreshed preset lists (`<vendor>.txt`, written by `scalwsctl client-address update`). Must be owned by root and not writable by group or others; a missing or invalid list means the one shipped with the release.
