| `resource_rewrite_disabled` | Bool | `false` | Normally, Tuliprox rewrites all image URLs in playlists to point to itself (e.g., `http://tuliprox:8901/resource/...`). If set to `true`, original URLs are kept (clients load images directly from the provider). **Warning:** Local caching will stop working if this is enabled! |
| `rewrite_secret` | String | `""` | A 32-character Hex string (16 bytes). Tuliprox encrypts/signs the original image URLs during the rewrite process. To prevent image URLs from becoming invalid after a server restart, you MUST enter a static secret here. |
| `retry` | Bool | `true` | **Background:** If the upstream provider unexpectedly drops the connection or a TCP network timeout occurs, Tuliprox immediately opens a new connection to the provider and seamless pipes the new bytes to the end-client. |
| `buffer.enabled` | Bool | `false` | Enables an asynchronous ring-buffer in RAM between the provider download stream and the client upload stream. Necessary if the provider stream is faster than the consumer can process. |
| `buffer.size` | Int | `0` | The size of the buffer in *Chunks* (1 Chunk = 8192 Bytes). A value of `1024` equals approximately 8 Megabytes of RAM per active stream. |
| `throttle_kbps` | Int | `0` | **Background:** Some players download VODs (Movies) at maximum line speed ("Bursting"). Providers often view this as abuse or scraping and will ban the IP. By throttling (e.g., to `12500` kbps), you force the download into a constant, inconspicuous flow. Supports units like `KB/s`, `MB/s`, `kbps`, `Mibps`. |
| `metrics_enabled` | Bool | `false` | **Monitoring:** If active, Tuliprox samples the live bandwidth (in kbps) and transferred bytes for every active reverse-proxied stream and pushes them via WebSockets to the Web UI. It adds a tiny bit of CPU overhead but is invaluable for debugging buffering issues. |
| `grace_period_millis` | Int | `2000` | The exact time window in ms where a temporary over-allocation is allowed (see notes on [The VLC Seek Problem](#the-vlc-seek-problem--grace-periods) for details). |
| `grace_period_hold_stream` | Bool | `true` | Tuliprox artificially holds back video data to the client, waiting for grace check to finish, so it doesn't trigger provider prematurely. |
| `hls_session_ttl_secs` | Int | `15` | Keeps virtual provider slot open between HLS segment (`.ts`) requests to prevent provider bans for "Account Hopping". |
| `catchup_session_ttl_secs` | Int | `45` | Same session-holding principle applied to Archive/Catchup TV. See notes on section [Session TTLs for HLS & Catchup](#session-ttls-for-hls-m3u8--catchup) for details. |
| `shared_burst_buffer_mb` | Int | `12` | Minimum burst buffer size (in MB) used for shared live streams to immediately synchronize new clients without Keyframe dropouts. See notes on section [Shared Live Streams](#shared-live-streams) for details. |
* **Option A:** Both `retry: false` and `buffer.enabled: false` ➔ The provider stream is piped directly to the client with minimal overhead.
* **Option B:** Either `retry: true` or `buffer.enabled: true` ➔ Tuliprox uses complex stream handling with a higher memory footprint to ensure stability.
| `referer_header` | Bool | `false` | Suppresses the source of the request. Prevents your Tuliprox instance from being logged at the provider. |
| `x_header` | Bool | `false` | **Critical:** Wildcard-strips all headers starting with `X-`. These are the most common indicators used for proxy detection. |
* Gives you a reliable answer to questions like "Which stream failed?", "Was this a provider abort or a capacity problem?",
and "How often does this stream reconnect?"
* Builds the raw data foundation for later QoS analysis and failover optimization.
* Adds asynchronous background disk writes, but does not put synchronous work into the live streaming hotpath.
```yaml
reverse_proxy:
stream_history:
stream_history_enabled:true
stream_history_batch_size:128
stream_history_retention_days:30
stream_history_directory:./stream_history
```
### Stream History Parameters
| Parameter | Type | Default | Technical Impact |
| :--- | :--- | :--- | :--- |
| `stream_history_enabled` | Bool | `false` | Master switch for stream telemetry. If disabled, no stream history files are written. |
| `stream_history_batch_size` | Int | `128` | Number of records buffered before the writer flushes a block to disk. Higher values reduce write frequency; lower values make new records visible sooner. |
| `stream_history_retention_days` | Int | `14` | Number of UTC day partitions retained before old history files are deleted. |
| `stream_history_directory` | String | `stream_history` under `storage_dir` | Directory for daily stream history files. Relative paths are resolved against `storage_dir`. |
### Technical Background
* Stream history records are written asynchronously in append-friendly daily files.
* Recorded event types include:
* successful connect
* startup failure (`connect_failed`)
* disconnect
* Recorded QoS metadata includes:
* disconnect reason
* startup failure reason
* failure stage
* provider error class / HTTP status
* reconnect counts
* first-byte latency
* stream identity fields for later aggregation
---
## 8. QoS Aggregation (`qos_aggregation`)
This block enables the periodic QoS aggregation worker. It reads stream history in the background and builds
compact per-stream QoS snapshots that summarize recent reliability.
* Lets you see a condensed reliability view without manually scanning raw history files.
* Prepares the data that the later failover feature can use to prioritize the most reliable stream/provider candidates.
* Keeps heavy analysis work out of request handling and out of the streaming hotpath.
```yaml
reverse_proxy:
stream_history:
stream_history_enabled:true
qos_aggregation:
enabled:true
interval_secs:300
```
### QoS Aggregation Parameters
| Parameter | Type | Default | Technical Impact |
| :--- | :--- | :--- | :--- |
| `enabled` | Bool | `false` | Enables the background QoS worker. Only effective if `stream_history.stream_history_enabled` is also `true`. |
| `interval_secs` | Int | `300` | Polling interval for the aggregation loop. Lower values update snapshots faster but increase background disk and CPU work. |
### Technical Background
* The worker reads raw stream history by UTC day and stores snapshots in dedicated B+Tree databases.
* Snapshots are keyed by stable stream identity and contain rolling `24h`, `7d`, and `30d` windows.
* QoS data is persisted locally, so it survives restarts and can later be consumed by the failover feature without rescanning all history every time.
* If stream history is disabled, QoS aggregation is automatically disabled during config preparation.