Crates.io | subconverter |
lib.rs | subconverter |
version | |
source | src |
created_at | 2025-03-24 21:39:13.391558+00 |
updated_at | 2025-04-24 20:06:41.656349+00 |
description | A more powerful utility to convert between proxy subscription format |
homepage | |
repository | |
max_upload_size | |
id | 1604441 |
Cargo.toml error: | TOML parse error at line 17, column 1 | 17 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
A more powerful utility to convert between proxy subscription formats, transformed from the C++ version subconverter! This Rust implementation offers improved performance and reliability while maintaining compatibility with the original.
⚠️ BETA VERSION AVAILABLE ⚠️ - This project is now in beta. Core features are implemented but may still have some rough edges.
Demo部署,测试时请注意隐私风险: https://subconverter-rs.netlify.app/
The following table shows the support status of different proxy protocols in various rule types:
Protocol \ Rule Type | Clash | SingBox | Surge(2,3,4) | V2Ray | Quantumult | Quantumult X | Loon | Surfboard | Mellow | SIP002/8 | Mixed | TG-like |
---|---|---|---|---|---|---|---|---|---|---|---|---|
VLESS | ✅ | ✅ | ⚠️ | ✅ | ❌ | ⚠️ | ⚠️ | ❌ | ❌ | ❌ | ⬇️ | ⬇️ |
Hysteria/2 | ✅ | ✅ | ⚠️ | ❌ | ⚠️ | ⚠️ | ⚠️ | ⚠️ | ⚠️ | ❌ | ⬇️ | ⬇️ |
VMess | ✅ | ✅ | ⚠️ | ✅ | ⚠️ | ⚠️ | ⚠️ | ⚠️ | ⚠️ | ❌ | ✅ | ⬇️ |
Trojan | ✅ | ✅ | ⚠️ | ❌ | ⚠️ | ⚠️ | ⚠️ | ⚠️ | ⚠️ | ❌ | ✅ | ⬇️ |
SS | ✅ | ✅ | ⚠️ | ❌ | ⚠️ | ⚠️ | ⚠️ | ⚠️ | ⚠️ | ✅ | ✅ | ⬇️ |
SSR | ✅ | ✅ | ⚠️ | ❌ | ⚠️ | ⚠️ | ⚠️ | ⚠️ | ⚠️ | ❌ | ✅ | ⬇️ |
HTTP/SOCKS | ✅ | ✅ | ⚠️ | ❌ | ⚠️ | ⚠️ | ⚠️ | ⚠️ | ⚠️ | ❌ | ⬇️ | ⬇️ |
WireGuard | ✅ | ✅ | ⚠️ | ⬇️ | ❌ | ⚠️ | ⚠️ | ⚠️ | ❌ | ❌ | ⬇️ | ⬇️ |
Snell | ❌ | ❌ | ⚠️ | ❌ | ❌ | ⚠️ | ⚠️ | ⚠️ | ❌ | ❌ | ⬇️ | ⬇️ |
SSD | ⬇️ | ⬇️ | ⬇️ | ⬇️ | ⬇️ | ⬇️ | ⬇️ | ⬇️ | ⬇️ | ⬇️ | ❌ | ⬇️ |
Legend:
Notes:
ss
, ssr
, v2ray
, and mixed
parameters.&remarks=
for naming and &group=
for group naming. These parameters need to be URLEncoded.mixed
, all supported nodes will be output as a normal subscription (Base64 encoded).Download and run the helper script directly (requires curl
and jq
):
curl -sSL https://raw.githubusercontent.com/lonelam/subconverter-rs/main/scripts/setup_and_run_subconverter.sh | bash
This downloads the latest release, extracts it to a subconverter
directory, and starts the server.
(Or manually download from Releases).
docker pull lonelam/subconverter-rs
docker run -d -p 25500:25500 lonelam/subconverter-rs
cargo install subconverter
git clone https://github.com/lonelam/subconverter-rs.git
cd subconverter-rs
cargo build --release --features=web-api
The binary will be available at target/release/subconverter-rs
.
http://127.0.0.1:25500/sub?target=%TARGET%&url=%URL%&config=%CONFIG%
Parameter | Required | Example | Description | Status |
---|---|---|---|---|
target |
Yes | surge&ver=4 |
Target configuration type | ✅ |
url |
Yes | https%3A%2F%2Fwww.xxx.com |
Subscription link (URLEncoded) | ✅ |
config |
No | https%3A%2F%2Fwww.xxx.com |
External configuration (URLEncoded) | ✅ |
# Original subscription: https://example.com/subscribe/ABCDE?surge=ss
# URLEncoded: https%3A%2F%2Fexample.com%2Fsubscribe%2FABCDE%3Fsurge%3Dss
http://127.0.0.1:25500/sub?target=clash&url=https%3A%2F%2Fexample.com%2Fsubscribe%2FABCDE%3Fsurge%3Dss
# Original subscriptions:
# 1. https://example1.com/subscribe/ABCDE?clash=vmess
# 2. https://example2.com/subscribe/ABCDE?clash=vmess
# Combined with pipe: https://example1.com/subscribe/ABCDE?clash=vmess|https://example2.com/subscribe/ABCDE?clash=vmess
# URLEncoded: https%3A%2F%2Fexample1.com%2Fsubscribe%2FABCDE%3Fclash%3Dvmess%7Chttps%3A%2F%2Fexample2.com%2Fsubscribe%2FABCDE%3Fclash%3Dvmess
http://127.0.0.1:25500/sub?target=clash&url=https%3A%2F%2Fexample1.com%2Fsubscribe%2FABCDE%3Fclash%3Dvmess%7Chttps%3A%2F%2Fexample2.com%2Fsubscribe%2FABCDE%3Fclash%3Dvmess
# Original node: ss://YWVzLTEyOC1nY206dGVzdA==@192.168.100.1:8888#Example1
# URLEncoded: ss%3A%2F%2FYWVzLTEyOC1nY206dGVzdA%3D%3D%40192%2E168%2E100%2E1%3A8888%23Example1
http://127.0.0.1:25500/sub?target=clash&url=ss%3A%2F%2FYWVzLTEyOC1nY206dGVzdA%3D%3D%40192%2E168%2E100%2E1%3A8888%23Example1
For quick conversion from Surge to Clash without additional configuration:
http://127.0.0.1:25500/surge2clash?link=SurgeSubscriptionLink
Note: The Surge subscription link does NOT need to be URLEncoded.
Parameter | Required | Example | Description | Status |
---|---|---|---|---|
emoji |
No | true |
Enable emoji in node names | ✅ |
add_emoji |
No | true |
Add emoji before node names | ✅ |
remove_emoji |
No | true |
Remove existing emoji from node names | ✅ |
append_type |
No | true |
Add proxy type ([SS] , [SSR] , etc.) to node names |
✅ |
tfo |
No | true |
Enable TCP Fast Open | ✅ |
udp |
No | true |
Enable UDP support | ✅ |
scv |
No | true |
Skip certificate verification for TLS nodes | ✅ |
tls13 |
No | true |
Enable TLS 1.3 for nodes | ✅ |
sort |
No | true |
Sort nodes by name | ✅ |
include |
No | (regex) |
Only include nodes matching the pattern | ✅ |
exclude |
No | (regex) |
Exclude nodes matching the pattern | ✅ |
filename |
No | MyConfig |
Set the file name for the generated config | ✅ |
list |
No | true |
Output as node list or provider format | ✅ |
insert |
No | true |
Insert nodes from insert_url in config |
✅ |
prepend |
No | true |
Insert nodes at the beginning | ✅ |
subconverter-rs supports multiple configuration file formats. It will load configuration in the following priority order: pref.toml
, pref.yml
, pref.ini
.
[common]
- Global node filtering and base configuration settingsapi_mode
: API mode settingsapi_access_token
: Token for accessing private interfacesdefault_url
: Default subscription links to loadenable_insert
: Whether to add insertion nodesinsert_url
: URL for insertion nodesexclude_remarks
: Exclude nodes matching the patterninclude_remarks
: Only include nodes matching the patterndefault_external_config
: Default external configuration fileclash_rule_base
: Clash configuration templatesurge_rule_base
: Surge configuration template[userinfo]
- Rules for extracting user information from node namesstream_rule
: Rules for extracting traffic informationtime_rule
: Rules for extracting time information[node_pref]
- Node preferences (UDP, TFO, renaming, sorting)udp_flag
: Open UDP mode for nodestcp_fast_open_flag
: Open TFO mode for nodesskip_cert_verify_flag
: Turn off certificate checks for TLS nodestls13_flag
: Add TLS 1.3 parameters for nodessort_flag
: Sort nodes by nameappend_sub_userinfo
: Whether to append traffic informationclash_use_new_field_name
: Whether to use Clash's new field namesclash_proxies_style
: Clash configuration file format stylerename_node
: Node renaming rules[managed_config]
, [emojis]
, [ruleset]
, [proxy_group]
, [template]
There are several other configuration sections for managed config settings, emoji handling, custom rule sets, proxy groups, and template system settings. See the documentation for detailed information.
You can host configuration files on GitHub Gist or other accessible network locations. URL-encode the configuration URL and add it to the &config=
parameter in your API call.
For generating configurations locally, create a generate.ini
file:
[test]
path=output.conf
target=surge
ver=4
url=ss://Y2hhY2hhMjAtaWV0Zi1wb2x5MTMwNTpwYXNzd29yZA@www.example.com:1080#Example
Then run:
subconverter -g
Contributions are welcome! Please feel free to submit a Pull Request.
good first issue
or help wanted
.This project is licensed under the GPL-3.0+ License - see the LICENSE file for details.