Keyboard shortcuts

Press โ† or โ†’ to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Getting Started

xrat is a Rust-based CLI tool and daemon for managing proxy configurations. It imports subscription links, parses and normalizes proxy URIs, tests connectivity and performance, previews runtime configs for Xray-core and sing-box, manages an Xray/V2Ray local proxy runtime process, and exposes an HTTP API.

Prerequisites

  • Xray-core binary installed and available in PATH
  • sing-box binary (optional, used for sing-box parse/preview support)
  • Rust toolchain and just when building from source

Installation

Choose one install path:

  • Installation Script โ€” recommended Linux install from the latest verified release archive
  • Docker Install โ€” run the published container image with bundled Xray-core
  • Manual Binary Install โ€” download, verify, and place release files yourself
  • Build From Source โ€” Justfile-oriented workflow for local development builds and source installs

Configuration Directory

xrat uses a configuration directory with the following resolution order:

  1. --config <path> CLI flag
  2. XRAT_PATH environment variable
  3. ~/.config/xrat/

The directory layout:

~/.config/xrat/
โ”œโ”€โ”€ config.toml      # Application configuration
โ”œโ”€โ”€ db.sqlite        # SQLite database (default)
โ”œโ”€โ”€ runtime/         # Runtime session files (generated configs, logs)
โ””โ”€โ”€ logs/            # Xray/V2Ray process logs

Next Steps