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

test

Test connectivity and latency for stored configs.

xrat test [id] [flags]

Arguments

ArgumentDescription
idConfig ID to test. Omit to bulk-test matching configs

Filter Flags

When testing multiple configs (no id specified):

FlagDescription
--enabled-onlyFilter: only enabled configs
--active-onlyFilter: only the active config
--subscription <id>Filter: only configs from the given subscription ID

Stage Skip Flags

FlagDescription
--skip-icmpSkip the ICMP ping stage
--skip-tcpSkip the TCP connectivity stage
--skip-real-delaySkip the real-delay (HTTP round-trip) stage
--skip-downloadSkip the download speed stage
--skip-uploadSkip the upload speed stage (disabled by default)

URL Override Flags

FlagDescription
--test-url <url>Override the URL used for real-delay checks
--download-url <url>Override the URL used for download speed checks
--upload-url <url>Enable upload speed stage and set the HTTP POST target URL

Timeout Override Flags

FlagDescription
--icmp-timeout <ms>Override ICMP timeout in milliseconds
--tcp-timeout <ms>Override TCP connect timeout in milliseconds
--real-delay-timeout <ms>Override real-delay HTTP request timeout in milliseconds
--download-timeout <ms>Override download speed request timeout in milliseconds
--upload-timeout <ms>Override upload speed request timeout in milliseconds

Concurrency and Output Flags

FlagDescription
--concurrency <n>Bulk-test concurrency. 0 = auto-detect
--format <format>Output format: tsv, csv, json (default: tsv)
--output <file>Write bulk results to a file instead of stdout
--sort-by <field>Sort order: status, icmp, real-delay, download-speed, protocol, address (default: status)
--no-progressHide the animated progress bar

Ping Loop Flags

FlagDescription
--pingContinuously ping one config until Ctrl+C, printing a live summary
--ping-interval <ms>Interval between ping-loop iterations (default: 1000)

Historical Summary Flags

FlagDescription
--latest-run-summaryPrint a summary of the latest persisted test run and exit
--country <iso>Filter latest-run summary by endpoint country ISO code (e.g. US, DE)
--asn <filter>Filter latest-run summary by ASN (case-insensitive substring match)

Test Stages

The test command can record up to 5 probe result types:

StageMeasuresDefault
ICMPICMP ping success and latencyEnabled
TCPTCP connect success and latencyEnabled
Real DelayHTTP round-trip latency through proxyEnabled
DownloadDownload throughput through proxyDisabled
UploadUpload throughput through proxyDisabled

Stage Order

The default order for ICMP, real-delay, and download is configurable via config.toml:

[testing]
order = ["icmp", "real_delay", "download"]

TCP is used as a gate before real-delay when enabled. Upload runs after download only when --upload-url <url> is provided; there is no [testing.upload] config section.

Failure Policy

Controls behavior when a stage fails:

[testing]
failure_policy = "continue"  # "continue" | "skip_remaining" | "mark_failed"

Examples

Test a single config:

xrat test 42

Bulk-test all enabled configs with 4 workers:

xrat test --enabled-only --concurrency 4

Test with custom URLs and timeouts:

xrat test 1 \
  --test-url https://example.com/generate_204 \
  --download-url https://example.com/10mb.test \
  --real-delay-timeout 5000 \
  --download-timeout 15000

Skip ICMP and download stages:

xrat test 1 --skip-icmp --skip-download

Export results to CSV:

xrat test --enabled-only --format csv --output results.csv

Continuous ping loop:

xrat test 1 --ping --ping-interval 2000

View latest test run summary:

xrat test --latest-run-summary

Filter by country and ASN:

xrat test --latest-run-summary --country US --asn cloudflare

Output Formats

TSV (default)

Tab-separated values, easy to read in terminal:

ID	Protocol	Address	ICMP	TCP	Real Delay	Download	Status
1	vless	example.com:443	15ms	12ms	145ms	-	alive
2	vmess	edge.com:8443	-	-	-	-	timeout

CSV

Comma-separated values, spreadsheet compatible.

JSON

Machine-parseable JSON array with full test result details.

Failure Classification

Test failures are classified into categories:

CategoryDescription
DNSDNS resolution failed
TimeoutConnection or request timed out
RefusedConnection refused
UnreachableNetwork unreachable
PermissionDeniedPermission denied
TLSTLS handshake failed
AuthAuthentication failed
ProcessProxy process failed to start
ProxyProxy returned an error
UnknownUnclassified failure
  • list configs โ€” view configs before testing
  • connect โ€” start a proxy for a tested config