whatisgithub

What is sni-balancer?

hrostami/sni-balancer — explained in plain English

Analysis updated 2026-05-18

43PythonAudience · developerComplexity · 3/5Setup · moderate

In one sentence

A Python tool that continuously tests a list of proxy server configs for speed and reliability, then automatically runs the best one as a local SOCKS5 proxy.

Mindmap

mindmap
  root((repo))
    What it does
      Tests proxy configs
      Scores by speed
      Runs best config
      Auto switches
    Tech stack
      Python
      Xray engine
      SOCKS5 proxy
    Use cases
      Pick fastest server
      Automate failover
      Monitor via dashboard
    Audience
      Researchers
      Network tinkerers
    Requirements
      Python 3 point 9 plus
      curl
      Internet access

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Automatically pick and run the fastest, most stable proxy config from a list of candidates.

USE CASE 2

Keep a local SOCKS5 proxy running that other apps on your network can point at.

USE CASE 3

Track how reliable each proxy config has been over time using saved history data.

USE CASE 4

Test a subscription URL full of configs without manually trying each one.

What is it built with?

PythonXraySOCKS5

How does it compare?

hrostami/sni-balanceralibaba/omnidoc-tokenbencharccalc/dwmfix
Stars434343
LanguagePythonPythonPython
Setup difficultymoderatemoderateeasy
Complexity3/53/52/5
Audiencedeveloperresearchergeneral

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires an external SNI-spoofing binary (Rust or Go) which the tool can auto-download if missing.

So what is it?

SNI-Balancer is a Python tool that automatically picks the best proxy connection out of a list of candidates and keeps it running for you. It is built around Xray, a proxy engine, and works with VLESS and Trojan style server configs, which are common formats for setting up encrypted proxy connections. Instead of you manually testing servers and switching between them, this tool does that job continuously in the background. The way it works is straightforward. You give it a list of configs in a text file, either as direct links or as a subscription URL that returns many configs at once. The balancer then starts short-lived, isolated test instances of Xray for each config and measures three things: whether the server responds at all, how fast it actually downloads real data through the proxy, and how low its latency is. It combines these into a weighted score, favoring speed most heavily, then stability and latency, and keeps track of each config's performance history across runs. The single best-scoring config is then launched as a real, ongoing local SOCKS5 proxy that other apps on your network can connect to. The tool keeps re-testing on a set interval and will only switch to a different config if the improvement clears a minimum threshold, so it will not swap back and forth over tiny differences. Configs that repeatedly fail get skipped more and more over time rather than retried constantly. The project also manages the underlying Xray binary and an SNI-spoofing helper program for you, downloading and updating them automatically if they are missing, and it can display a live dashboard of current status while running. It works on Linux, Windows, and macOS, requires Python 3.9 or newer plus curl, and is run from the command line with options to change the test interval, listening port, or test size. The README describes it as intended for educational and research purposes and asks users to follow local laws.

Copy-paste prompts

Prompt 1
Walk me through how the scoring system in this tool weighs speed, latency, and stability.
Prompt 2
Help me set up a configs.txt file with a mix of vless and trojan links for this tool.
Prompt 3
Explain what SNI spoofing is and why this project needs a separate backend for it.
Prompt 4
Show me how to run this tool in dry-run mode to test configs without launching the proxy.

Frequently asked questions

What is sni-balancer?

A Python tool that continuously tests a list of proxy server configs for speed and reliability, then automatically runs the best one as a local SOCKS5 proxy.

What language is sni-balancer written in?

Mainly Python. The stack also includes Python, Xray, SOCKS5.

How hard is sni-balancer to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is sni-balancer for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.