Xray Settings#
💡 Tip: You can change these settings directly in the bgscan application instead of editing the TOML file manually.
Navigate to Settings → Xray Settings in the main menu to configure these options interactively using the TUI inspector.
Configuration file: settings/xray_settings.toml
This file controls the Xray outbound validation module, which tests connectivity and bandwidth to remote servers.
Quick Reference#
| Setting | Default | Description |
|---|---|---|
timeout | 6000 | Maximum duration (in milliseconds) to wait for an Xray connectivity test to complete. |
workers | 32 | Number of concurrent workers performing Xray connectivity tests. |
connectivity_test_type | 3 | Type of connectivity test: 0 = connectivity only, 1 = download only, 2 = upload only, 3 = both download and upload. |
download_speed | 100 | Target download data size (in KB) for the test (used when test type includes download). |
upload_speed | 50 | Target upload data size (in KB) for the test (used when test type includes upload). |
prefix_output | "xray_" | Filename prefix applied to all output files generated by this module. |
pre_scan_type | "tcp" | Pre-scan connectivity test to perform before running Xray: none, icmp, tcp, or http. |
Timeout#
timeout = 6000Maximum duration (in milliseconds) to wait for an Xray connectivity test to complete. Tests failing to respond within this window are considered failed.
Recommended values:
3000-6000for reliable networks6000-12000for unreliable or distant networks
Workers#
workers = 32The number of concurrent workers performing Xray connectivity tests. Higher values increase test throughput at the cost of greater bandwidth and CPU utilization.
Recommended values:
8-16for limited resources16-32for typical use32-64for high-performance testing
Connectivity Test Type#
connectivity_test_type = 3The type of connectivity test to perform.
Supported values:
0= Connectivity only → Test if the server is reachable (basic connection)1= Download speed only → Measure only download performance2= Upload speed only → Measure only upload performance3= Both → Perform both download and upload speed tests
Default: 3 (both download and upload) — Recommended for comprehensive testing.
Download Speed#
download_speed = 100Target download data size (in KB) to test against. The test attempts to download this amount of data within the configured timeout.
Used only when connectivity_test_type includes download (1 or 3).
Recommended values:
50-200for moderate bandwidth testing200-1000for high-bandwidth testing
Upload Speed#
upload_speed = 50Target upload data size (in KB) to test against. The test attempts to upload this amount of data within the configured timeout.
Used only when connectivity_test_type includes upload (2 or 3).
Recommended values:
25-100for moderate bandwidth testing100-500for high-bandwidth testing
Prefix Output#
prefix_output = "xray_"The filename prefix applied to all output files generated by this module. Useful for distinguishing results when running multiple scans simultaneously.
Pre-scan Type#
pre_scan_type = "tcp"The pre-scan connectivity test to perform before running Xray. Options:
none→ Skip pre-scan, directly use Xrayicmp→ Test ICMP ping to target IP (uses ICMP settings)tcp→ Test TCP connection to target port (uses TCP settings)http→ Test HTTP/HTTPS request to target (uses HTTP settings)
Default: "tcp" — Recommended to verify basic connectivity before bandwidth testing.
Related Files#
general_settings.toml— Global scan control and pipeline modeicmp_settings.toml— ICMP scan configurationtcp_settings.toml— TCP port scan configurationhttp_settings.toml— HTTP/HTTPS/HTTP3 probe configurationdns_settings.toml— DNS scan configurationwriter_settings.toml— Result output configuration