Skip to content

SocialYjj/clash-sub-merger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

40 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

✈️ SubMerger

δΈ­ζ–‡ζ–‡ζ‘£

A modern and beautiful subscription aggregation management panel for Clash/Mihomo, supporting multi-subscription merging, custom nodes, user management, and smart format output.

License Python Go Docker

πŸ“Έ Screenshots

Dashboard Node Map
Dashboard Map
Subscriptions Nodes
Subscriptions Nodes
Add Node Templates
Add Node Templates
Settings Users
Settings Users

✨ Features

Subscription Management

  • πŸ”— Multi-subscription Aggregation - Merge multiple subscriptions into one
  • πŸ› οΈ Custom Nodes - Add your own nodes (vmess/vless/ss/trojan/hysteria2, etc.)
  • πŸ“ Local Import - Import subscriptions from local YAML/Base64 files
  • πŸ”„ Auto Refresh - Scheduled subscription updates with Cron expression
  • πŸ“Š Traffic Statistics - Display traffic usage and expiration time
  • 🎯 Drag & Drop Sorting - Customize node order

Node Management

  • 🌍 Global Node Map - Interactive ECharts world map visualization
  • ⚑ Go Speedtest Service - High-performance testing via mihomo library
    • Delay test (TCP latency)
    • Speed test with peak mode
    • Exit IP detection
  • 🌐 Online GeoIP APIs - No local database needed
    • Built-in: ip-api.com (45 req/min, Chinese), ipwhois.app, ipinfo.io
    • Custom API support with {ip} and {key} placeholders
    • Token security protection
    • City name translations (Tokyoβ†’δΈœδΊ¬, Seoulβ†’ι¦–ε°”)
    • Special region display (HK→中国香港, TW→中国台湾)
    • Async GeoIP lookup (v2.6.0) - Reduce "unknown" nodes with IP-based country detection
    • Case-insensitive city mapping (v2.6.0) - Support all case formats (Boydton/boydton/BOYDTON)
  • πŸ”— Proxy Chain - Create chained proxy configurations (Node A β†’ Node B β†’ Target)
  • πŸ”Œ Port Mapping - Map nodes to local ports for direct access (generates Clash listeners)
  • 🏷️ Smart Filtering - Filter by country, protocol, subscription, latency status
  • ↕️ Flexible Sorting - Sort by name, latency, speed (ascending/descending)
  • πŸ“ˆ Protocol Distribution - Pie chart analytics

Template Management

  • πŸ“ Custom Templates - Create and manage Clash configuration templates
  • πŸ”„ Placeholder System - Use {{ALL_PROXIES}}, {{COUNTRY_GROUPS}} for dynamic content
  • πŸ“€ Import/Export - Upload YAML files or create from scratch

User Management

  • πŸ‘₯ Multi-user Support - Create users with individual subscriptions
  • πŸŽ›οΈ Node Allocation - Assign specific nodes/subscriptions to users
  • 🎨 Visual Template Editor (v2.4.0) - Configure proxy groups for each user with visual interface
    • Edit node selection for each proxy group
    • Real-time YAML preview
    • Support for admin tokens
  • ⏱️ Expiration Control - Set user expiration dates

Subscription Output

  • πŸ“± Smart Format - Auto-detect client and return YAML or Base64
  • 🐱 One-click Import - Support clash:// protocol
  • πŸ“· QR Code - Scan to subscribe on mobile
  • πŸ“ Custom Template - Customize Clash configuration template

Security

  • πŸ” Password Protection - Panel access requires password
  • 🎫 Token Authentication - Subscription URL with token
  • πŸ”‘ Regenerate Token - Reset subscription token anytime

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Docker Container                  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚  Python/FastAPI │◄──►│  Go Speedtest Service   β”‚ β”‚
β”‚  β”‚   (port 8666)   β”‚    β”‚     (port 9876)         β”‚ β”‚
β”‚  β”‚                 β”‚    β”‚  - mihomo library       β”‚ β”‚
β”‚  β”‚  - API Server   β”‚    β”‚  - delay/speed test     β”‚ β”‚
β”‚  β”‚  - Frontend     β”‚    β”‚  - exit IP detection    β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Quick Deploy

Docker Compose (Recommended)

  1. Create docker-compose.yml:
services:
  submerger:
    image: ghcr.io/socialyjj/submerger:latest
    container_name: submerger
    restart: unless-stopped
    ports:
      - "8666:8666"
    volumes:
      - ./data:/app/data
    environment:
      - TZ=Asia/Shanghai
  1. Start:
docker-compose up -d
  1. Visit http://your-ip:8666

Build Manually

git clone https://github.com/SocialYjj/clash-sub-merger.git
cd clash-sub-merger
docker-compose up -d --build

πŸ“– Usage

First Time Setup

  1. Visit the panel and set admin password
  2. Add subscriptions or custom nodes
  3. Click "Subscribe" button to get the aggregated URL

Subscription Format

Client Format Note
Clash/FlClash/Stash YAML Auto-detect
V2RayN/V2RayNG Base64 Auto-detect
Shadowrocket YAML/Base64 Auto-detect
Manual - ?format=yaml or ?format=base64

Supported Protocols

  • VMess
  • VLESS (with Reality)
  • Shadowsocks (SS)
  • ShadowsocksR (SSR)
  • Trojan
  • Hysteria / Hysteria2
  • TUIC
  • WireGuard
  • AnyTLS
  • SOCKS5 / HTTP
  • Snell

πŸ”§ Configuration

Environment Variables

Variable Default Description
TZ UTC Timezone
DATA_DIR /app/data Data directory
PORT 8666 Server port

Data Persistence

All data is stored in /app/data:

  • config.json - Configuration (subscriptions, nodes, auth)
  • uploads/ - Subscription cache files

πŸ› οΈ Development

Backend

# Create virtual environment
uv venv
.venv\Scripts\activate  # Windows
source .venv/bin/activate  # Linux/Mac

# Install dependencies
uv pip install -r requirements.txt

# Run server
python server.py

Frontend

cd submerger
npm install
npm run dev

Build Frontend

cd submerger
npm run build

πŸ“„ License

Apache License 2.0

About

Modern subscription aggregation panel for Clash/Mihomo with Go speedtest service, online GeoIP, proxy chains, and beautiful UI

Topics

Resources

License

Stars

Watchers

Forks

Packages