CDN acceleration and security protection for this project are sponsored by Tencent EdgeOne.
The author of this project is colin1114.
🚀 Clash Subscription Converter
A beautiful and powerful online tool for converting various proxy subscription links to Clash configuration format. Supports automatic deployment via Cloudflare Workers & Pages, providing fast and reliable subscription conversion services.
✨ Features
- 🎨 Modern and Attractive Interface - Utilizes gradient backgrounds and card-style design
- 🔄 Multi-Protocol Support - Supports mainstream protocols such as V2Ray, VLESS, Shadowsocks, Trojan
- ☁️ Cloud Deployment - Global CDN acceleration via Cloudflare Workers
- 📱 Responsive Design - Perfectly adapts to both desktop and mobile devices
- ⚡ Fast Conversion - Instantly converts subscription links into Clash configuration
- 📋 Smart Copy - One-click copying of generated YAML configuration, compatible with various browsers
- 📡 Subscription Link Generation - Automatically generates subscription links importable to Clash
- 🌐 Online YAML Access - Provides multiple ways to access YAML files:
- 📡 Subscription Link: Supports automatic updates in Clash client
- 🔗 Online Viewing: View configuration directly in browser
- 💾 File Download: Download .yaml file locally
- ⚡ Quick Access: Simplified download link
- 🔧 UTF-8 Support - Fully supports Chinese node names and configurations
- 🆓 Completely Free - Based on Cloudflare's free service, no usage restrictions
📁 Project Structure
clash/
├── index.html # 前端页面
├── worker.js # Cloudflare Worker 后端代码
├── wrangler.jsonc # Wrangler 配置文件
├── _headers # Cloudflare Pages HTTP头配置
├── .github/
│ └── workflows/
│ └── deploy.yml # GitHub Actions 部署配置
├── README.md # 项目说明文档
└── package.json # 项目配置文件🚀 Quick Start
Method 1: Run Locally
- Clone the project
git clone
cd clash
``- Start the local server
`bash
# 使用 Python
python -m http.server 8000
# 或使用 Node.js
npx serve .
`- Access the Application
- Open your browser and visit
http://localhost:8000
The sample configuration will be displayed in the local environment Method 2: Deploy with Cloudflare Workers
#### Step 1: Create a Worker
- Visit Cloudflare Workers
- Register/Login to your Cloudflare account
- Click "Create a Worker"
- Copy the entire code from
worker.js into the editor
Click "Save and Deploy" #### Step 2: Deploy using Wrangler CLI
bash
安装 Wrangler CLI
npm install -g wrangler登录到 Cloudflare
wrangler login部署 Worker
npm run deploy:workerbash#### Step 3: Configure Domain Name (Optional)echo "No build required"
- Add a custom domain name in Worker settings
- Or use the default domain provided by Cloudflare
Method 3: Deploy with Cloudflare Pages
#### Option A: GitHub Integration (Recommended)
- Prepare Repository
- Push the code to your GitHub repository
- Ensure all necessary files are included
- Create Pages Project
- Visit Cloudflare Pages
- Connect your GitHub repository
- Select the project repository
- Build Settings
- Build command: leave blank or
/Build output directory: (root directory)Environment variables: no need to set #### Option B: Direct Upload
使用 Wrangler Pages 部署
npm run deploy:pagesjavascript 'proxy-groups': [ { name: '🚀 节点选择', type: 'select', proxies: ['♻️ 自动选择', '🎯 全球直连', ...proxyNames] }, // 添加更多代理组... ]GET /🛠️ Technical Architecture
Frontend Tech Stack
- HTML5 - Modern markup language
- CSS3 - Responsive design and animation effects
- Vanilla JavaScript - Lightweight frontend interactions
Backend Tech Stack
- Cloudflare Workers - Edge computing platform
- Web APIs - Standard Fetch API and response handling
Supported Protocol Formats
- VMess - V2Ray standard protocol
- VLESS - V2Ray lightweight protocol (supports Reality)
- Shadowsocks - Classic proxy protocol
- Trojan - Emerging proxy protocol
API Endpoints
- Main pagePOST /convert- Subscription conversion APIGET /clash/{config-id}- Retrieve YAML configuration file (subscription link)GET /yaml/{config-id}- Download YAML configuration fileOPTIONS /*- CORS preflight requestMissing entry-point to Worker script📖 User Guide
Basic Usage
- Enter Subscription Link
- Paste your proxy subscription link into the input box
- Supports Base64-encoded subscription links
- Set Configuration Name
- Optionally set a custom name for your configuration file
- Defaults to "My Clash Config"
- Convert Configuration
- Click the "Convert Subscription" button
- Wait for the conversion to complete
- Using Configuration
- Copy the generated YAML configuration
- Import it into the Clash client for use
- Using Subscription Link (Recommended)
- Copy the generated subscription link
- Add the subscription in the Clash client
- The configuration will automatically sync, no manual update needed
Advanced Configuration
The generated Clash configuration includes the following features:
- Proxy Group Policies
- 🚀 Node Selection - Manually select proxy
- ♻️ Auto Selection - Delay test auto selection
- 🎯 Global Direct - Direct connection
- DNS Configuration
- Enable DNS resolution
- Supports fake-ip mode
- Domestic and overseas DNS split
- Routing Rules
- Local addresses direct connection
- Domestic IP direct connection
- Other traffic via proxy
🔧 Deployment Troubleshooting
Common Issues
#### 1. Wrangler Cannot Find Entry Point Error Message:
wrangler.jsoncSolution:
- Make sure there is a
file in the project root directorymainCheck that the field inwrangler.jsoncpoints toworker.jsCLOUDFLARE_API_TOKEN#### 2. GitHub Actions Deployment Failed Solution:
- Add the following Secrets in your GitHub repository settings:
: Cloudflare API tokenCLOUDFLARE_ACCOUNT_ID: Cloudflare account IDecho "No build required"#### 3. Pages Build Failed Solution:
- Set the build command to empty or
/Make sure the build output directory is set to wrangler.jsoncDeployment Configuration File Description
: Wrangler CLI configuration for Worker deployment_headers: Cloudflare Pages HTTP header configuration.github/workflows/deploy.yml: GitHub Actions automatic deployment configurationconvertToClash🔧 Custom Configuration
Modify Proxy Groups
You can edit the
function inworker.jsto customize proxy groups:
javascript rules: [ 'DOMAIN-SUFFIX,youtube.com,🚀 节点选择', 'DOMAIN-SUFFIX,local,DIRECT', // 添加更多规则... ] `rulesCustom Routing Rules
Modify the
array to add custom routing rules:
📊 Performance Features
- Global CDN - Cloudflare covers global edge nodes
- Fast Response - Average response time < 100ms
- High Availability - 99.9% service uptime
- Free Quota - 100,000 requests per day
🔒 Security Instructions
- Data Privacy - Subscription data is only used during conversion and is not stored
- HTTPS Encryption - All communication is encrypted via HTTPS
- Open Source Transparency - Full source code is public and can be independently audited
🤝 Contribution Guide
Issues and Pull Requests are welcome!
- Fork this repository
- Create a feature branch (
git checkout -b feature/AmazingFeature)
Commit your changes ( git commit -m 'Add some AmazingFeature')
Push to the branch ( git push origin feature/AmazingFeature`)
📝 Changelog
v1.1.0
- ✅ Added support for VLESS protocol (including Reality secure transport)
- ✅ Improved protocol compatibility
v1.0.0
- ✅ Basic subscription conversion functionality
- ✅ Elegant user interface
- ✅ Cloudflare Workers support
- ✅ Multi-protocol support (VMess, Shadowsocks, Trojan)
- ✅ Responsive design
- ✅ One-click copy feature
📞 Support and Feedback
If you encounter any problems or have suggestions during use, please:
- Check this README document
- Submit an Issue
- Start a Discussion
📄 License
This project uses the MIT License - see the LICENSE file for details
🙏 Acknowledgements
- Cloudflare Workers - Provides edge computing platform
- Clash - Excellent proxy client
- Support from all contributors and users
⭐ If this project is helpful to you, please give it a Star!
--- Tranlated By Open Ai Tx | Last indexed: 2025-09-06 ---