Docs GitHub
-- --
Theme:
Language:
EN فا

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#

SettingDefaultDescription
timeoutplatform-dependentMaximum duration (in milliseconds) to wait for the Xray connectivity test to complete.
speed_test_timeoutplatform-dependentMaximum duration (in milliseconds) to wait for each download/upload speed test.
workersplatform-dependentNumber of concurrent workers performing Xray connectivity tests.
connectivity_test_type3Type of connectivity test: 0 = connectivity only, 1 = download only, 2 = upload only, 3 = both download and upload.
download_speedplatform-dependentMinimum acceptable download speed in Kbps (used when the test type includes download).
upload_speedplatform-dependentMinimum acceptable upload speed in Kbps (used when the test type includes upload).
output_prefix"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.
max_concurrent_dialsplatform-dependentMax concurrent outbound dials process-wide (0 = unlimited).
dial_max_attemptsplatform-dependentDial attempts per outbound dispatch.

Timeout#

timeout = 6000

Maximum 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-6000 for reliable networks
  • 6000-12000 for unreliable or distant networks

Speed Test Timeout#

speed_test_timeout = 6000

Maximum duration (in milliseconds) for each download and upload speed test. The amount of data transferred by a speed test derives from this timeout and the configured speed minimum (speed_test_timeout seconds × download_speed/upload_speed Kbps), so the test always transfers enough data to judge the target against the minimum.

Recommended values:

  • 3000-8000 for typical speed testing
  • 8000-15000 for high-bandwidth targets or unstable networks

Workers#

workers = 32

The 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-16 for limited resources
  • 16-32 for typical use
  • 32-64 for high-performance testing

Connectivity Test Type#

connectivity_test_type = 0

The 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 performance
  • 2 = Upload speed only → Measure only upload performance
  • 3 = Both → Perform both download and upload speed tests

Download Speed#

download_speed = 100

Minimum acceptable download speed in Kbps. The probe transfers download_speed * timeout worth of data and fails the target if the measured speed falls below this value. Used only when connectivity_test_type is 1 or 3.

Recommended values:

  • 50-200 for moderate bandwidth testing
  • 200-1000 for high-bandwidth testing

Upload Speed#

upload_speed = 50

Minimum acceptable upload speed in Kbps. Works the same way as download_speed, and applies when connectivity_test_type is 2 or 3.

Recommended values:

  • 25-100 for moderate bandwidth testing
  • 100-500 for high-bandwidth testing

Output Prefix#

output_prefix = "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 = "none"

A cheaper reachability check run before Xray starts. Targets that fail the pre-scan never reach the Xray stage.

  • none → Skip pre-scan, directly use Xray
  • icmp → 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)

Max Concurrent Dials#

max_concurrent_dials = 128

Caps how many outbound dials may run at the same time across all workers. 0 means unlimited. Lower it when the machine runs out of sockets or file descriptors during large scans. Range is 0-10000.

Dial Max Attempts#

dial_max_attempts = 3

How many times each outbound dispatch retries its dial before giving up. Range is 1-10.