Skip to content

mehdirzfx/xray-balancer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Xray Balancer

Smart proxy load balancer for Xray-core with automatic failover, latency monitoring, and intelligent node switching.


image

Features

  • Smart automatic node switching

  • Lowest-latency balancing

  • Automatic failover

  • Round-robin balancing mode

  • Interactive CLI

  • SOCKS5 + HTTP local proxy

  • Colored terminal logs

  • Multi-protocol support:

    • VMess
    • VLESS
    • Trojan
    • Shadowsocks
  • Lightweight and fast

  • Cross-platform:

    • Windows
    • Linux
    • macOS
  • Built with Go


Why Xray Balancer?

Managing multiple Xray nodes manually can be frustrating.

Xray Balancer automatically monitors node latency and switches to the best available proxy without interrupting your workflow.

Perfect for:

  • unstable networks
  • multi-node setups
  • automatic failover
  • low-latency routing
  • daily proxy usage

Installation

Download Binary

Download the latest release from the Releases page.

Build From Source

git clone https://github.com/mehdirzfx/xray-balancer
cd xray-balancer

go build -o xray-balancer ./cmd

Cross-Platform Build

Linux

CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o release/xray-balancer-linux ./cmd

Windows

CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o release/xray-balancer.exe ./cmd

macOS

CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o release/xray-balancer-macos ./cmd

Quick Start

1. Create configs.txt

vmess://...
vless://...
trojan://...
ss://...

2. Run

./xray-balancer

Local Proxy

After startup:

SOCKS5 → 127.0.0.1:10808
HTTP   → 127.0.0.1:10809

CLI Options

-f <file>           Config file
-c <file>           App config JSON
-port <int>         Local SOCKS5 port
-ping-interval <n>  Ping interval
-mode <mode>        best | round_robin
-log <level>        none|error|warning|info|debug
-i=false            Disable interactive CLI
-v                  Show version

Interactive Commands

status      Show node status
switch N    Manually switch node
ping        Show latency information
help        Show help
quit        Exit

Example App Config

{
  "local_port": 10808,
  "ping_interval": 30,
  "ping_timeout": 10,
  "ping_url": "http://www.gstatic.com/generate_204",
  "switch_mode": "best",
  "log_level": "warning"
}

Project Structure

cmd/                Application entrypoint
internal/
  balancer/         Core balancing logic
  config/           Config parser
  ping/             Latency checking
  proxy/            Xray proxy management
core/               Core binaries
release/            Build outputs

Roadmap

  • Web dashboard
  • REST API
  • Prometheus metrics
  • Geo balancing
  • Smart health scoring
  • Historical latency tracking
  • Benchmark mode

Contributing

Pull requests and ideas are welcome.

If you find bugs or want new features, open an issue.


License

MIT License


Author

Developed by:

GitHub: https://github.com/mehdirzfx

About

Smart proxy load balancer for Xray-core with automatic failover, latency monitoring, and intelligent node switching.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors