Parses Hysteria2, AnyTLS, VLESS (including xhttp), Trojan, VMess, Shadowsocks, TUIC, and other protocol URIs
mihomo-subconverter — Next.js Tool Template
By ififi2017
A self-hosted Mihomo / Clash subscription converter built with Next.js. Paste proxy links, choose a rule template, and generate a working config subscription URL. Supports one-click deployment to Vercel.
Explore the design
Compare the page layouts and mobile experience. Open any screenshot for a closer look.
Actual screenshot captured by the server browser.
All pages & views 2
Screenshots show visual appearance; interactive behavior may differ.
What stands out
A quick read of the recorded project description.
Accepts conversion links, base64 subscriptions, or Clash proxies: YAML; nodes are extracted locally and remote airport URLs are not fetched
Rule templates use the ACL4SSR / sub-web compatible INI format, defaulting to MetaCubeX Full, with support for .list and .mrs rule sets
Generated YAML rewrites GitHub raw / gh-proxy rule set addresses to testingcf.jsdelivr.net for easier access from mainland China
Provides one-click Vercel deployment, runs with zero environment variables, and optionally hardens public deployments with ACCESS_TOKEN and TEMPLATE_ALLOWED_HOSTS
Interface supports English and Chinese; adding a language only requires adding a locales JSON and registering it in lib/i18n.js
Template Details
mihomo-subconverter is a self-hosted Mihomo / Clash subscription converter built with Next.js and released under the MIT license. Its core workflow: paste proxy node links into the interface, select a rule template, and generate a subscription link that can be entered directly into Mihomo-compatible clients. The project provides a one-click Vercel deploy button and runs with zero environment variables; it can also be started locally with npm install and npm run dev.
For input, it supports Hysteria2 (hysteria2://, hy2://), AnyTLS, VLESS (including type=xhttp / splithttp), Trojan, VMess, Shadowsocks, TUIC, and other protocol URIs. It can also accept conversion links generated by this tool, base64 subscription content, or the proxies: section of a Clash configuration. Nodes are parsed locally; it does not fetch remote airport URLs. Rule templates use the ACL4SSR / sub-web INI convention, defaulting to the MetaCubeX Full template, with rule sets from MetaCubeX/meta-rules-dat in .mrs binary format. In the generated YAML, GitHub raw / gh-proxy rule set addresses are rewritten to testingcf.jsdelivr.net for access from mainland China.
Additional features include: custom rules (prepended as highest-priority DOMAIN-SUFFIX / IP-CIDR rules), the ability to bind a custom domain that is automatically used in generated links, English and Chinese interfaces, and optional ACCESS_TOKEN and TEMPLATE_ALLOWED_HOSTS environment variables to harden public deployments. The API consists of GET /api/clash and POST /api/clash; the UI preview uses POST to avoid node URIs appearing in the request URL, while the subscription link copied to clients remains GET.
Limitations and notes: the generated subscription link embeds node credentials in the URL, equivalent to a password; anyone who obtains the link or request logs along the way can read the nodes. Setting ACCESS_TOKEN only prevents strangers from using your deployment; it does not change this. The project does not fetch remote airport subscription URLs. Third-party assets such as demo images, fonts, and icons must be checked separately under their respective licenses; the code's MIT license does not cover them.
Is it right for your project?
Use Cases
- Convert multiple proxy node URIs into a subscription link directly usable by Mihomo / Clash clients
- Self-host a subscription conversion service and bind your own domain so generated links automatically use it
- Define proxy groups and rule sets with a custom INI template, or append highest-priority DOMAIN-SUFFIX / IP-CIDR rules to built-in rules
- Restrict others from calling the /api/clash and /api/preview-template endpoints on a public deployment via ACCESS_TOKEN
- Find a template format that can be directly reused for existing sub-web remote configuration links
Suitable For
- Users who need self-hosted Mihomo / Clash subscription conversion and want zero-config deployment to Vercel
- Those familiar with the ACL4SSR / sub-web INI template format who want to customize proxy groups and rule sets
- Users who need to access rule sets from mainland China and want generated links to go through the jsDelivr mirror
- Developers who want the interface to support Chinese and English, or plan to add other languages themselves
Getting started & customization
Use these recorded setup notes alongside the repository instructions for your chosen version.
- 1
One-click Vercel deployment requires no environment variables; local runs use npm install and npm run dev, with the default address http://localhost:3000
- 2
Optionally set ACCESS_TOKEN so that /api/clash and /api/preview-template require a matching token query parameter; the UI detects this automatically and prompts for input
- 3
Optionally set TEMPLATE_ALLOWED_HOSTS as a host suffix allowlist for custom template URLs; when unset, any public http(s) host is allowed, while internal/private addresses are always rejected
- 4
After binding a custom domain in the Vercel project under Settings → Domains, subscription links generated through that domain automatically use it
- 5
Generated subscription links embed node credentials and should be treated like passwords; setting ACCESS_TOKEN only prevents others from using your deployment and does not change the link's readability
License & source material
Usage conditions & limitations
Free to use · keep license noticeThis entry covers the free version under the MIT license in the public repository; the free scope is the code of that version and does not imply that external services or third-party assets are free.
Must comply with when using
- Free use, modification, commercial use, and distribution of this version's code are permitted.
- When distributing copies or substantial portions of the code, retain the original author's copyright notice and the full MIT license notice.
- The code is provided as is; warranties and limitations of liability are governed by the original license and applicable law.
Additional costs & items to verify
- Demo images, fonts, icons, and other third-party assets must be checked under their respective licenses; the code's MIT license alone cannot be used to judge them.
- External services such as domains, hosting, databases, payments, or AI may incur separate charges.
- The project runs with zero configuration; ACCESS_TOKEN and TEMPLATE_ALLOWED_HOSTS are optional hardening variables, not required.
- After setting ACCESS_TOKEN, calls to /api/clash and /api/preview-template must carry a matching token query parameter, otherwise access is denied.
- TEMPLATE_ALLOWED_HOSTS is a host suffix allowlist for custom template URLs; when unset, any public http(s) host is allowed, while internal/private addresses are always rejected.
- Generated subscription links embed node credentials in the URL, equivalent to a password; anyone who obtains the link or request logs along the way can read the nodes.
- Setting ACCESS_TOKEN only prevents strangers from using your deployment; it does not prevent link holders from reading node credentials.
- The converter only parses nodes locally and does not fetch remote airport subscription URLs.
- Generated YAML rewrites GitHub raw / gh-proxy rule set addresses to the testingcf.jsdelivr.net mirror.
- The default template UI link uses the jsDelivr-CF mirror for opening from mainland China; GitHub raw is used only as a fallback during generation.
- API parameters must be URL-encoded exactly once (standard query string encoding).
- The subscription link copied to Mihomo remains a GET URL; clients can only fetch it via GET.
View Original Text Basis
Permission is hereby granted, free of charge
Original License Text
The converter works with zero configuration, but two optional variables harden a public deployment
Original README
When set, `/api/clash` and `/api/preview-template` require a matching `token` query parameter.
Original README
Comma-separated host allowlist for custom template URLs, matched by suffix (e.g. `githubusercontent.com` also allows `raw.githubusercontent.com`). When unset, any public http(s) host is allowed; private/internal addresses are always rejected.
Original README
generated subscription links embed your node credentials in the URL. Treat them like passwords — anyone with the link (or access to request logs along the way) can read your nodes.
Original README
Setting `ACCESS_TOKEN` does not change this; it only prevents strangers from using your deployment.
Original README
both are parsed locally and the converter still does **not** fetch remote airport URLs.
Original README
GitHub raw / gh-proxy ruleset URLs are rewritten to `testingcf.jsdelivr.net` in the generated YAML
Original README
The UI links to the jsDelivr-CF mirror so the file opens in mainland China; GitHub raw is only a fallback at generate time.
Original README
Parameters must be URL-encoded exactly once (standard query-string encoding).
Original README
https://github.com/ififi2017/mihomo-subconverter/blob/main/LICENSEhttps://github.com/ififi2017/mihomo-subconverter/blob/main/README.mdThe **subscription link** copied into Mihomo remains a GET URL — clients can only fetch that way.
Original README
Compiled by DeepSeek based on repository license and README ·2026-10-04. Results only cover the materials read; dependencies, images, fonts, and subsequent term changes are subject to their respective original texts.
Project checks & description sources
Template Information
- Source platforms
- GitHub
- Documentation and maintenance reference score
- More documented · 83 / 100
- Technologies
- Next.js · React
- Website type
- Tool Site
How this score is calculated
Our heuristic uses license records (up to 30), a demo link (12), a preview (10), stars (15), recorded maintenance (15), description completeness (8), feature records (5) and classification data (5). It is not a code, security or performance test, or a Google score. A link does not establish tested functionality.
What to verify for this project
- Repository update recorded
- 2026-10-04
- Screenshot last checked
- 2026-10-04
A demo link is listed. Check it with your own content and viewport sizes; its presence does not confirm that forms, authentication or payments work.
The catalog identifies Next.js as the primary stack. Check the actual dependency manifest and lockfile for versions and hosting requirements. These notes use recorded metadata, not a code audit or a deployment test.
Use a selection guide →How this description was prepared
AI-assisted description based on catalog records and repository material. Repository authors are not automatically the reviewers of this description.
Review declaration: [email protected] · 2026-10-04
Inspect the recorded source material
SHA-256: 94ef109baf2e86d2334adf97a90cc77ec64d523a574acb22ad3bdde55fc9704c
2026-10-04T17:12:53.212Z
Source file / repository# Mihomo Subscription Converter
[](https://vercel.com/new/clone?repository-url=https://github.com/ififi2017/mihomo-subconverter)
[](LICENSE)
[](https://nextjs.org)
A lightweight Mihomo / Clash subscription converter. Paste your proxy node links, choose a rule template, and get a ready-to-use configuration file — deployable to Vercel in one click.
> Rule sets are powered by [MetaCubeX/meta-rules-dat](https://github.com/MetaCubeX/meta-rules-dat) in `.mrs` binary format. Template format follows the [ACL4SSR](https://github.com/ACL4SSR/ACL4SSR) / sub-web INI convention for compatibility. Protocol parsing patterns reference [sublink-worker](https://github.com/7Sageer/sublink-worker) by 7Sageer.
---
## Supported Protocols
| Protocol | URI prefix |
|----------|-----------|
| Hysteria2 | `hysteria2://` / `hy2://` |
| AnyTLS | `anytls://` |
| VLESS | `vless://` (including `type=xhttp` / `splithttp`) |
| Trojan | `trojan://` |
| VMess | `vmess://` |
| Shadowsocks | `ss://` |
| TUIC | `tuic://` |
Converter links are also supported — paste a subscription URL generated by this tool (or any URL that carries node URIs in its `config` query parameter), and the nodes are extracted automatically. You can also paste a **base64 subscription blob** or a Clash config's **`proxies:`** section; both are parsed locally and the converter still does **not** fetch remote airport URLs.
---
## Features
- **Multi-protocol** — Hysteria2, AnyTLS, VLESS (incl. xhttp), Trojan, VMess, Shadowsocks, TUIC
- **Converter / base64 / YAML import** — Paste a converter link, a base64 subscription, or Clash `proxies:` YAML; nodes are extracted locally (remote airport URLs are never fetched)
- **INI rule templates** — Bundled MetaCubeX Full template with jsDelivr mirrors (works in mainland China), or point to any compatible `.ini` file
- **China-reachable rule sets** — GitHub raw / gh-proxy ruleset URLs are rewritten to `testingcf.jsdelivr.net` in the generated YAML
- **sub-web compatible** — Template URLs work with [CareyWang/sub-web](https://github.com/CareyWang/sub-web) remote config links without modification
- **Custom rules** — Prepend your own `DOMAIN-SUFFIX` / `IP-CIDR` rules at highest priority
- **Live subscription URL** — Generated link always reflects your current proxy list; paste it once into any Mihomo-compatible client
- **Custom domain aware** — Bind a custom domain in Vercel; generated links use it automatically
- **i18n** — English and Chinese UI; adding a new language takes two steps (see below)
- **Zero-config deploy** — No environment variables needed (optional hardening available, see below)
---
## Deploy to Vercel
### One-click deploy
Click the **Deploy with Vercel** button above. Fork the repo and deploy — no environment variables required.
### Custom domain
Add your domain under **Vercel project → Settings → Domains**. Once set up, any subscription link generated through your domain will automatically use it — no extra configuration needed.
### Optional environment variables
The converter works with zero configuration, but two optional variables harden a public deployment (set them under **Vercel project → Settings → Environment Variables**):
| Variable | Effect |
|----------|--------|
| `ACCESS_TOKEN` | When set, `/api/clash` and `/api/preview-template` require a matching `token` query parameter. The UI detects this automatically and prompts for the token (stored in the browser, appended to generated links). |
| `TEMPLATE_ALLOWED_HOSTS` | Comma-separated host allowlist for custom template URLs, matched by suffix (e.g. `githubusercontent.com` also allows `raw.githubusercontent.com`). When unset, any public http(s) host is allowed; private/internal addresses are always rejected. |
> **Security note:** generated subscription links embed your node credentials in the URL. Treat them like passwords — anyone with the link (or access to request logs along the way) can read your nodes. Setting `ACCESS_TOKEN` does not change this; it only prevents strangers from using your deployment.
### Run locally
```bash
npm install
npm run dev
```
Open http://localhost:3000
### Run tests
```bash
npm test
```
---
## Usage
1. **Paste nodes** — Add proxy URIs one per line, a previously generated converter link, a base64 subscription, or a Clash YAML `proxies:` section (embedded nodes are extracted locally)
2. **Rule template** *(optional)* — Leave empty to use the default MetaCubeX Full template, or paste a URL to your own `.ini` file
3. **Custom rules** *(optional)* — Add rules that take priority over all built-in ones
4. **Generate** — Click **Generate Config** or press `Ctrl / ⌘ + Enter`
5. **Use it** — Copy the subscription link into your client's remote profile URL field
---
## Rule Templates
The converter uses an ACL4SSR-compatible INI file to define proxy groups and rule sets.
**Default template** (used when the Custom Template URL field is left empty). The UI links to the jsDelivr-CF mirror so the file opens in mainland China; GitHub raw is only a fallback at generate time. A snapshot is also bundled in `templates/MetaCubeX_Full.ini`.
```
https://testingcf.jsdelivr.net/gh/ififi2017/clash_rules@master/config/MetaCubeX_Full.ini
```
Open the link above to see a working example of the expected format — it's a good starting point for writing your own template.
### Using a custom template
1. Copy the default template above as a starting point
2. Edit the `custom_proxy_group` and `ruleset` lines to suit your needs
3. Host the file on GitHub (raw URL), any CDN, or a static file server
4. Paste the URL into the **Custom Template URL** field in the UI
**sub-web compatibility:** The template format follows the ACL4SSR / sub-web INI convention — any remote config URL that works in [CareyWang/sub-web](https://sub-web.pages.dev/) ([GitHub](https://github.com/CareyWang/sub-web)) under "远程配置" will also work here without modification. Both `.list` and `.mrs` rule formats are supported.
### Template format reference
```ini
; Lines starting with ; or # are comments
; Proxy groups — backtick-separated fields
custom_proxy_group=🚀 Node Select`select`[]♻️ Auto Select`[]DIRECT
custom_proxy_group=♻️ Auto Select`url-test`.*`http://www.gstatic.com/generate_204`300,,50
custom_proxy_group=🇭🇰 HK Nodes`url-test`(HK|Hong Kong|港)`http://www.gstatic.com/generate_204`300,,50
; Rule sets — GROUP,URL or GROUP,[]INLINE_RULE
; .list (classical text) and .mrs (MetaCubeX binary) are both supported
ruleset=🛑 AdBlock,https://example.com/rules/ban.list
ruleset=🎯 Direct,https://example.com/rules/cn.mrs
ruleset=🎯 Direct,[]GEOIP,CN
ruleset=🐟 Catch-all,[]FINAL
```
**Proxy group types:**
| Type | Fields after type |
|------|-------------------|
| `select` | `[]GroupName` or `[]DIRECT` / `[]REJECT` (one per backtick field) |
| `url-test` | `filter-regex` · `health-check-url` · `interval,,tolerance` |
| `fallback` | same as `url-test` |
| `load-balance` | same as `url-test` |
**Special inline rules:**
| INI value | Clash output |
|-----------|-------------|
| `[]FINAL` | `MATCH,<group>` |
| `[]GEOIP,CN` | `GEOIP,CN,<group>,no-resolve` |
| `[]IP-CIDR,x.x.x.x/y` | `IP-CIDR,x.x.x.x/y,<group>` |
---
## API
```
GET /api/clash?config=<encoded_links>[&template=<encoded_url>][&customRules=<json_array>][&groups=<json_array>][&token=<token>]
POST /api/clash
```
The UI uses **POST** for preview generation (node URIs stay out of the request URL). The **subscription link** copied into Mihomo remains a GET URL — clients can only fetch that way.
`POST` JSON body fields match the query parameters (`config`, `template`, `customRules`, `groups`, `token`). `token` may also be sent as a query parameter.
| Parameter | Description |
|-----------|-------------|
| `config` | URL-encoded proxy URIs (newlines), Clash YAML `proxies:` section, or a base64 subscription |
| `template` | URL-encoded `.ini` template URL (optional, defaults to MetaCubeX Full) |
| `customRules` | JSON array of custom rule strings (optional) |
| `groups` | JSON array of rule-group names to include (optional, defaults to all) |
| `token` | Access token, required only when the deployment sets `ACCESS_TOKEN` |
Parameters must be URL-encoded exactly once (standard query-string encoding).
**Example:**
```bash
curl "https://your-domain.vercel.app/api/clash?config=hysteria2%3A%2F%2Fpwd%40host%3A443%3Fpeer%3Dsni%23MyNode"
```
---
## Adding a New Language
Translations live in the `locales/` directory as plain JSON files. Adding a new language requires two steps:
**1. Create the translation file**
Copy `locales/en.json` to `locales/<lang>.json` (use a [BCP 47](https://en.wikipedia.org/wiki/IETF_language_tag) language code, e.g. `ja`, `ko`, `fr`) and translate the values.
**2. Register the language**
In `lib/i18n.js`, add two lines:
```js
import ja from '../locales/ja.json' // 1. import the file
export const LOCALES = {
en: { name: 'English', messages: en },
zh: { name: '中文', messages: zh },
ja: { name: '日本語', messages: ja }, // 2. register it here
}
```
That's it — the language switcher in the header will pick it up automatically. PRs are welcome!
---
## License
MIT
Explore similar templates
Compare previews and descriptions within the same stack and category.

tiktokenizer
tiktokenizer is an open-source online tool site built with Next.js, TypeScript, and React that calculates token counts for text using the openai/tiktoken library.
Next.js · Tool Site

resume builder
An open-source resume builder built with Next.js, TypeScript, Material UI, and Zustand. It offers multiple templates and themes, real-time editing and preview, and requires no registration.
Next.js · Tool Site

picprose
PicProse is an open-source, Next.js-based cover image generator for bloggers, content creators, and developers. It fetches images via the Unsplash API, supports custom titles, author info, fonts, colors, and transparency, offers multiple aspect ratios, and exports to JPG, PNG, and SVG.
Next.js · Tool Site

notty
Notty is an offline-first note-taking app template built with Next.js, TypeScript, React, Cloudflare Workers, and Yjs.
Next.js · Tool Site

gfw
gfw is the official Global Forest Watch web application, an open-source tool site with a live online demo.
Next.js · Tool Site

la resume
la resume is an open-source online resume builder built with Next.js, TypeScript, and React. It provides ATS-optimized templates, one-click PDF/LaTeX export, requires no registration, and supports PWA installation.
Next.js · Tool Site
