subconverter-rs
A more powerful utility to convert between proxy subscription format, the original codes are transformed from the cpp version subconverter by Cursor!
Transform. Optimize. Simplify. A blazingly fast proxy subscription converter rewritten in Rust.
⚠️ WORK IN PROGRESS ⚠️ - This project is currently under active development. Features may be incomplete or subject to change.
subconverter-rs takes the power of the original subconverter project and reimplements it in Rust, bringing memory safety, concurrency without data races, and significantly improved performance.
Why Rust?
- Performance: Experience comparable or better performance than C++ with Rust's zero-cost abstractions
- Memory Safety: Eliminate segmentation faults and buffer overflows without sacrificing performance
- Concurrency: Safe concurrent processing for handling multiple subscriptions simultaneously
- Modern Tooling: Benefit from Cargo's dependency management, testing framework, and documentation generation
- Cross-Platform: Easily compile for various platforms with minimal configuration
- Maintainability: More readable, modular code that's easier to extend and contribute to
Why ?
The subconverter is not easy to use and can be really hard to contribute, more than half of PRs are aborted.
However, the subconverter is almost the only one tool that could provide compatibility about a bunch of proxy tools.
Supported Features
- Converting between various proxy subscription formats
- Filtering nodes based on remarks and rules
- Adding emojis to node remarks
- Renaming nodes based on custom rules
- Preprocessing nodes with custom rules
- Parsing local configuration files
- Command line interface
Supported Proxy Types
- VMess
- Shadowsocks
- ShadowsocksR
- Trojan
- HTTP/HTTPS
- SOCKS
- Hysteria/Hysteria2
- WireGuard
- Snell
Supported Output Formats
- Clash
- Surge
- Quantumult
- Quantumult X
- Loon
- ShadowsocksD (SSD)
- Mellow
- SingBox
Installation
From Source
The binary will be available at target/release/subconverter-rs.
From Cargo
Usage
Command Line
Library
You can use subconverter-rs as a library in your Rust projects:
use Proxy;
use ;
Examples
Check out the examples directory for more usage examples:
Configuration
subconverter-rs uses similar configuration to the original subconverter.
Development
Contributions are welcome! Please feel free to submit a Pull Request.
How to Contribute
- Pick an issue: Check our issue tracker for tasks labeled
good first issueorhelp wanted - Implement new proxy types: Help expand support for additional proxy protocols
- Improve parsing: Enhance the robustness of the various format parsers
- Add tests: Increase test coverage to ensure stability
- Documentation: Improve docs or add examples to help others use the project
- Performance optimizations: Help make the converter even faster
For questions or discussions, you can:
- Open an issue on GitHub
Roadmap
- Basic proxy parsing and conversion
- Node filtering and manipulation
- Complete VMess protocol support
- Web interface for online conversion
- HTTP server for subscription conversion
- RESTful API
- Plugin system for easy extension
- Complete feature parity with original subconverter
- Performance benchmarks vs. original implementation
- Docker container and CI/CD pipelines
License
This project is licensed under the MIT License - see the LICENSE file for details.
Architecture
The project is organized into several key modules:
models module
- Contains core data structures used throughout the application
- Defines
ProxyandProxyTypeas the canonical type definitions - Separates data models from processing logic for better maintainability
parser module
types: Defines configuration types likeConfTypeexplodes: Contains parsers for different proxy formats (VMess, Shadowsocks, etc.)subparser: High-level parsing functionality
generator module
- Handles conversion between different formats
- Contains node manipulation functions like filtering and renaming
utils module
- Common utilities used across the codebase
This architecture separates concerns between data models, parsing logic, and output generation, making the codebase easier to maintain and extend.