A Rust CLI utility for generating Xray configuration files from VPN server URLs.
- Parse server URLs with protocols:
ss://,vless://,vmess://,trojan://,hysteria2:// - Generate configuration files for Xray
- Automatic load balancing across server groups (Cloudflare, WARP, others)
- Proxy server availability checking before adding to configuration
- Configurable timeout for availability checks
- Support for all major transport protocols (WebSocket, gRPC, TCP)
- Support for Reality and TLS encryption
- Execution logging
- Error handling and data validation
cargo build --releasecargo run -- --url "https://raw.githubusercontent.com/STR97/STRUGOV/refs/heads/main/STR.BYPASS" --output "./configs"--url/-u- URL to the server list file--output/-o- Directory for saving configuration files (default:./configs)--check-availability/-c- Enable proxy availability checking before adding to configuration (default:false)--timeout/-t- Timeout for availability checks in seconds (default:5)
Basic usage without availability checking:
cargo run -- --url "https://example.com/servers.txt" --output "./configs"With availability checking (5 second timeout):
cargo run -- --url "https://example.com/servers.txt" --output "./configs" --check-availabilityWith availability checking and custom timeout:
cargo run -- --url "https://example.com/servers.txt" --output "./configs" -c -t 10Contains configuration for all outbound servers:
- Shadowsocks servers
- VLESS servers with Reality/TLS support
- VMess servers with WebSocket/gRPC support
- Trojan servers with TLS/Reality
- Hysteria2 servers with obfuscation
- Standard
directandblockservers
Contains routing rules and load balancers:
claude-balance- for Cloudflare serverswarp-balance- for WARP serversproxy-balance- for other proxies- Ad blocking rules
- Local address rules
- ✅ URL-encoded and standard base64
- ✅ All base64 formats (STANDARD, URL_SAFE, NO_PAD)
- ✅ Query parameters (e.g.,
?prefix=...) - ✅ All encryption methods
- ✅ Reality with fingerprint, SNI, publicKey, shortId, spiderX
- ✅ TLS with ALPN, fingerprint, allowInsecure
- ✅ WebSocket, gRPC, TCP transports
- ✅ Support for
/?URL format
- ✅ Base64-encoded JSON configuration
- ✅ WebSocket, gRPC, TCP transports
- ✅ TLS encryption
- ✅ AlterID and custom security methods
- ✅ WebSocket, gRPC, TCP transports
- ✅ TLS and Reality encryption
- ✅ Passwords with special characters
- ✅ Support for
/?URL format
- ✅ Email addresses as passwords
- ✅ Obfuscation (salamander)
- ✅ SNI customization
- ✅ Certificate pinning
- ✅ Support for
/?URL format
- 43 tests - 100% passing
- 5 protocols fully supported
- Edge cases handled (URL encoding, various formats)
Test URLs for verification:
# Shadowsocks
ss://Y2hhY2hhMjAtaWV0Zi1wb2x5MTMwNTpwYXNzd29yZA@example.com:8388#server
# VLESS with Reality
vless://uuid@example.com:443?type=grpc&security=reality&sni=example.com&fp=firefox&pbk=key&sid=id#server
# VMess
vmess://base64_encoded_json
# Trojan
trojan://password@example.com:443/?type=ws&path=/trojan&security=tls#server
# Hysteria2
hysteria2://auth@example.com:443?obfs=salamander&sni=example.com#server
To control logging level, use the environment variable:
RUST_LOG=debug cargo run -- --url "..." --output "./configs"src/
├── main.rs # CLI and main logic
├── parser.rs # Server URL parsing
├── checker.rs # Proxy availability checking
└── config/
├── mod.rs # Module exports
├── outbound.rs # Outbound configuration generation
└── routing.rs # Routing configuration generation
When using the --check-availability flag, the utility checks TCP connectivity to each proxy server:
- ✓ Successful connection - server is added to configuration
- ✗ Failed connection - server is excluded from the list
Logging shows check results for each server:
✓ Server vless-server-1 is available
✗ Server ss-server-2 is unavailable: Connection timed out
Optimization: Checks are performed in parallel using the Rayon library, significantly speeding up the process with many servers.
Note: Availability checking increases configuration generation time. With parallel processing, time ≈ timeout + DNS resolution time, instead of (number_of_servers × timeout).
The project uses GitHub Actions for automatic configuration generation:
- 🕐 Scheduled runs (daily at 00:00 UTC)
- 🔘 Manual triggering via GitHub UI
- 📦 Automatic releases with artifacts
See .github/workflows/build-and-release.yml for details
A multi-stage Dockerfile is available:
docker build -t xray-config-gen .
docker run --rm -v $(pwd)/output:/app/configs xray-config-gen \
--url "https://example.com/servers.txt" \
--output /app/configs