| icon | lucide/home |
|---|
Subcon is a subscription converter server that renders Clash, Surge, and URI
outputs from local profiles or remote subscriptions. Conversion is driven by
schema/ and conf/, so you can tune behavior without recompiling.
!!! info "Why Subcon"
- Schema-driven mapping keeps protocol support consistent.
- Profiles and rules live on disk for quick iteration.
- A single /sub endpoint delivers target-specific output.
Subcon includes an embedded control panel at / for managing profiles, rules,
schema mappings, and runtime control actions.
- Login uses the server URL and
common.api_access_token. - API access is same-origin only (CSRF-protected).
- Credentials are stored in the browser for convenience and can be cleared via Logout.
graph LR
A[Profiles or remote URL] --> B[Schema registry]
B --> C[Optional inserts and node prefs]
C --> D[Target renderer]
D --> E[Clash / Surge / URI output]
| Software | Import | Export | Notes |
|---|---|---|---|
| Clash | Yes | Yes | Import expects Clash profile YAML. |
| Surge | No | Yes | VLESS not supported. |
| URI | Yes | Yes | One URI per line. |
=== "Local profiles"
bash curl "http://127.0.0.1:25500/sub?target=clash"
=== "Remote subscription"
bash curl "http://127.0.0.1:25500/sub?target=clash&url=https://example.com/sub"
!!! danger "Security note"
To prevent abuse and ensure security, remote subscription `url` requests are restricted by `network.allowed_domain`.
| Name | Required | Description |
|---|---|---|
target |
yes | clash, surge, or uri. |
url |
no | Remote subscription URL. |
token |
no | Matches common.api_access_token to include inserts. |
??? info "Where configs come from"
- conf/base/ provides base templates.
- conf/snippets/ defines proxy groups and rulesets.
- conf/profiles/ supplies local proxy lists.
- schema/ maps protocols to each target.
conf/- runtime configuration, profiles, and rules.schema/- protocol schemas and target mapping.src/- server and renderer implementation.docs/- documentation sources.