# Daemon config

###### Settings that apply to the daemon as a whole (license, proxy ports, and inspector limits) live in `~/.localcan/config.yml`.

Every key is optional. The file is written by the CLI (`localcan license activate` updates `license-key`, the desktop app may write `device-name`, etc.) but it is plain YAML you can also edit by hand.

```yaml title="~/.localcan/config.yml"
license-key: localcan_xxxxxxxxxxxxx
device-name: my-laptop

proxy_http:
  enabled: false
proxy_https:
  enabled: true
  port: 443

inspector:
  max_entries: 250
  max_body_size: 10485760        # 10 MB
```

#### License and device

| Key | Type | Notes |
| --- | --- | --- |
| `license-key` | string | Set by `localcan license activate`. |
| `device-id` | string | Auto-generated UUID. Don't edit. |
| `device-name` | string | Shown in the dashboard's device list. |
| `usage-data-allowed` | bool | Off unless set to `true`. When omitted, nothing is sent. Set by `--usage-data` / `--no-usage-data` during activation. |

#### Proxy

The HTTPS proxy is enabled by default. The HTTP proxy is disabled. Each block has the same shape:

| Key | Type | Default | Notes |
| --- | --- | --- | --- |
| `proxy_http.enabled` | bool | `false` | Master switch for the HTTP proxy. |
| `proxy_http.port` | int | `80` | Override only if `:80` is taken. |
| `proxy_https.enabled` | bool | `true` | Master switch for the HTTPS proxy. |
| `proxy_https.port` | int | `443` | Override only if `:443` is taken. |

If you disable both proxies, only the tunnel transport stays available. Local `.local` domains stop being served.

> [!NOTE]
> Proxy changes are picked up on `localcan reload`. The daemon stops the old listener and starts a new one on the requested port without dropping unrelated connections. No restart needed.

#### Inspector

The traffic inspector keeps a rolling buffer of recent HTTP requests and responses for the desktop app's inspector view. When body sizes get large, content spills to disk.

| Key | Type | Default | Notes |
| --- | --- | --- | --- |
| `inspector.max_entries` | int | `250` | Maximum number of request/response pairs kept in memory. |
| `inspector.max_body_size` | int | `10485760` (10 MB) | Bodies larger than this are truncated before storage. |
| `inspector.body_memory_threshold` | int | `131072` (128 KB) | Bodies under this size stay in memory, larger spill to disk. |
| `inspector.body_memory_cap` | int | `52428800` (50 MB) | Total in-memory body budget across all entries. |
| `inspector.body_disk_cap` | int | `524288000` (500 MB) | Total on-disk body budget across all entries. |

Sizes are bytes. Lower these on machines with tight memory or disk. Raise them if you're debugging a webhook with megabytes of payload.

> [!NOTE]
> Inspector limits are read at daemon start. After editing, restart the daemon to apply: `localcan restart -d`.

