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 SettingsXray 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
timeout6000Maximum duration (in milliseconds) to wait for an Xray connectivity test to complete.
workers32Number 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_speed100Target download data size (in KB) for the test (used when test type includes download).
upload_speed50Target 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 = 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

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 = 3

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

Default: 3 (both download and upload) — Recommended for comprehensive testing.


Download Speed#

download_speed = 100

Target 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-200 for moderate bandwidth testing
  • 200-1000 for high-bandwidth testing

Upload Speed#

upload_speed = 50

Target 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-100 for moderate bandwidth testing
  • 100-500 for 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 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)

Default: "tcp" — Recommended to verify basic connectivity before bandwidth testing.