explaingit

linuxgarry/clashx-random-proxy

Analysis updated 2026-05-18

0PythonAudience · ops devopsComplexity · 4/5Setup · hard

TLDR

A self-hosted proxy pool that maps HTTP ports to randomly rotating live proxy nodes stored in a PostgreSQL database.

Mindmap

mindmap
  root((clashx-random-proxy))
    What it does
      Proxy node pool
      Port to IP mapping
      Daily health checks
    Tech stack
      Python
      FastAPI
      PostgreSQL
    Use cases
      IP rotation
      Home server proxy
      Node health testing
    Audience
      Ops and DevOps

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

Run a home-server proxy service that rotates exit IPs by refreshing a port endpoint.

USE CASE 2

Automatically test a large pool of proxy nodes daily and remove dead ones.

USE CASE 3

Give each application a dedicated port that maps to a different live proxy on demand.

What is it built with?

PythonFastAPIPostgreSQLDocker

How does it compare?

linuxgarry/clashx-random-proxy0xhassaan/nn-from-scratch3ks/embedoc
Stars00
LanguagePythonPythonPython
Last pushed2023-06-08
MaintenanceDormant
Setup difficultyhardmoderatehard
Complexity4/54/51/5
Audienceops devopsdeveloperdeveloper

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

How do you get it running?

Difficulty · hard Time to first run · 1h+

Requires Docker, macvlan networking, and an external PostgreSQL database, personal-use project.

In plain English

clashx-random-proxy is a self-hosted proxy pool that turns a database of Clash protocol proxy nodes into a simple HTTP proxy service, where each port number maps to a randomly selected live exit IP address. The setup stores a large collection of proxy nodes, supporting protocols including vmess, vless, trojan, and others, inside a PostgreSQL database. Every day at 3am the system tests every node for connectivity, marking each one as alive or inactive based on the result. When you request a specific port number through GET /proxy/{port}, the service picks a random live node, assigns it to that port, and that port then functions as a usable HTTP proxy. Requesting the same port again swaps in a different node, which makes rotating your exit IP as simple as refreshing the endpoint. Ports that go unused for 5 minutes are automatically released back into the pool. The service runs as a single Docker container that combines two processes: mihomo, which handles the actual proxy connections and listens across a configurable port range, and a FastAPI web service that manages node selection, exposes the API endpoints, and runs the daily health test using APScheduler. The two processes are linked together so that if either one exits, the whole container restarts. It is designed to run on a home server, uses macvlan networking to give the container a fixed LAN IP address, and connects out to an external PostgreSQL database rather than bundling one. Configurable settings include the port range, the testing schedule, the batch size used for node testing, and the concurrency level. The README notes plainly that this is a private project intended for personal use only, not a public service.

Copy-paste prompts

Prompt 1
Help me deploy this Docker container with macvlan networking on my home server.
Prompt 2
Explain how mihomo and the FastAPI service work together inside this container.
Prompt 3
Walk me through configuring the port range and daily health test schedule.
Prompt 4
Show me how to connect this project to an external PostgreSQL database.

Frequently asked questions

What is clashx-random-proxy?

A self-hosted proxy pool that maps HTTP ports to randomly rotating live proxy nodes stored in a PostgreSQL database.

What language is clashx-random-proxy written in?

Mainly Python. The stack also includes Python, FastAPI, PostgreSQL.

How hard is clashx-random-proxy to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is clashx-random-proxy for?

Mainly ops devops.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.