A fully functional cross-platform Clash proxy tool built with Flutter π
This is a production-ready Clash proxy management tool with actual proxy protocol implementations, similar to clash-verge-rev but built with Flutter for true cross-platform support. Unlike typical Flutter UI demos, this project includes working proxy protocols (Trojan, Shadowsocks) with SOCKS5 server support.
π BREAKING NEWS: Clash now works on Android! The implementation includes a complete VPN service with in-process TUN device packet processing, traffic interception, and proxy forwarding.
- β Trojan Protocol - Full implementation with SHA224 authentication
- β Shadowsocks Protocol - AEAD ciphers (AES-GCM, ChaCha20-Poly1305)
- β SOCKS5 Server - Auto-detection, IPv4/IPv6/domain support
- β HTTP CONNECT - HTTPS tunneling support
- π VMess Protocol - Planned (FFI integration recommended)
- Home - Dashboard with traffic monitor and system status
- Proxies - Node management with speed testing and group support
- Profiles - Subscription management with YAML parsing
- Connections - Real-time connection monitoring
- Rules - Routing rules display
- Logs - Application logs with filtering
- Test - Batch proxy speed testing
- Settings - System configuration
- β Real Proxy Connections - Connect through Trojan/Shadowsocks servers
- β YAML Configuration - Parse and load Clash subscription files
- β Speed Testing - TCP latency measurement for all nodes
- β Password Management - Secure credential parsing and storage
- β Proxy Groups - Support for selector/url-test/fallback groups
- β Persistent State - SharedPreferences for configuration persistence
- β Auto-Reconnect - Automatically reconnects to last selected proxy on startup
- β Traffic Monitoring - Real-time upload/download statistics
- β Local Proxy Server - SOCKS5/HTTP on port 1080 (configurable)
- β Android VPN - Full VPN integration with in-process TUN processor
- β Private Rules - Password-protected rule editing (4-digit PIN)
lib/protocols/
βββ trojan_protocol.dart # Trojan protocol (SHA224 auth, TCP tunnel)
βββ shadowsocks_protocol.dart # Shadowsocks AEAD (AES-GCM, ChaCha20)
βββ socks5_handler.dart # SOCKS5 server (RFC 1928)
lib/services/
βββ clash_state.dart # State management (Provider)
βββ proxy_service.dart # Local proxy server & connections
lib/models/
βββ clash_models.dart # ProxyNode, ProxyGroup, Profile, etc.
lib/pages/
βββ home_page.dart # Dashboard
βββ proxies_page.dart # Proxy management (scrollable groups)
βββ profiles_page.dart # Subscriptions
βββ connections_page.dart # Connection monitor
βββ rules_page.dart # Routing rules
βββ logs_page.dart # Application logs
βββ test_page.dart # Speed testing
βββ settings_page.dart # Configuration
- Flutter 3.35.4 or higher
- Dart 3.9.2 or higher
- Clone the repository:
git clone https://github.com/Worthies/Clash.git
cd Clash- Install dependencies:
flutter pub get- Run the application:
flutter run # Auto-select device
flutter run -d linux # For Linux
flutter run -d windows # For Windows
flutter run -d macos # For macOS
flutter run -d android # For Android
flutter run -d ios # For iOS
flutter run -d chrome # For Web- Launch the app
- Go to Profiles page
- Add a Clash subscription URL
- Activate the profile (parses proxies and groups)
- Go to Proxies page
- Select a proxy node
- Test speed or connect to the proxy
- Configure your browser/system to use SOCKS5:
127.0.0.1:1080
Comprehensive documentation is available in the /docs directory:
- ARCHITECTURE.md - Project structure and design patterns
- QUICKSTART.md - Installation and usage guide
- SOCKS5_SUPPORT.md - SOCKS5 protocol implementation details
- PROXY_CONFIGURATION.md - Proxy credentials and YAML parsing
- PROXY_CONNECTION.md - Protocol implementation status
- IMPLEMENTATION.md - Complete feature implementation summary
- UI_DESIGN.md - Visual design specifications
- COMPARISON.md - Feature comparison with clash-verge-rev
- name: 'My Trojan Server'
type: trojan
server: example.com
port: 443
password: your-password-here
sni: example.com
udp: true
skip-cert-verify: false- name: 'My SS Server'
type: ss
server: example.com
port: 8388
cipher: chacha20-ietf-poly1305
password: your-password-here
udp: true
plugin: obfs
plugin-opts:
mode: http
host: cloudflare.comThe app runs a local proxy server on:
- Default Port: 1080
- Protocols: SOCKS5 (recommended), HTTP CONNECT
- Binding: 127.0.0.1 (localhost only)
Configure your applications to use:
SOCKS5 Proxy: 127.0.0.1:1080
No Authentication Required
flutter test- Load a Clash YAML subscription
- Select a Trojan or Shadowsocks node
- Click "Connect"
- Use a SOCKS5 client to test:
curl --socks5 127.0.0.1:1080 https://ifconfig.me- Click "Test Speed" on individual nodes
- Or use "Test All" button to batch test all nodes
- Results are sorted by latency (fastest first)
- Speed data persists across app restarts
- flutter: SDK
- provider: ^6.1.2 - State management
- http: ^1.2.1 - HTTP requests
- shared_preferences: ^2.2.3 - Local storage
- yaml: ^3.1.3 - YAML parsing
- crypto: ^3.0.3 - Cryptographic operations
- cupertino_icons: ^1.0.8 - iOS icons
- flutter_test: SDK - Testing framework
- flutter_lints: ^4.0.0 - Code quality
- Persistent display on all pages
- Real-time upload/download statistics
- Formatted byte values (B, KB, MB, GB)
- Color-coded indicators (blue=upload, green=download, orange=total)
- Scrollable Groups - Responsive layout with flexible node cards
- Speed Indicators - Green (<500ms), Orange (<1000ms), Red (>1000ms)
- Protocol Display - TCP/UDP badges for each node
- Delay Information - Always visible with last test timestamp
- Group-Only Display - Only shows proxies that belong to groups
- Persistent Selection - Remembers selected nodes per group
- YAML format parsing (Clash standard)
- Auto-parse proxies, groups, and rules
- Base64 encoded subscriptions supported
- Credential extraction (passwords, ciphers, SNI)
- Profile management with activation status
- View active connections in real-time
- Per-connection traffic statistics
- Source/destination information
- Protocol and network type display
- β Password parsing from YAML subscriptions
- β Cipher configuration for Shadowsocks
- β SNI support for Trojan TLS handshake
- β Certificate verification options
β οΈ Note: Credentials stored in SharedPreferences (plain text)- π Recommendation: Use flutter_secure_storage for production
| Feature | Status | Notes |
|---|---|---|
| Trojan Protocol | β Complete | SHA224 auth, TCP tunnel |
| Shadowsocks | β Complete | Simplified AEAD (needs FFI for production) |
| SOCKS5 Server | β Complete | IPv4/IPv6/domain, NO AUTH |
| HTTP CONNECT | Basic support in raw socket mode | |
| VMess Protocol | β Planned | Recommend FFI to v2ray-core |
| UDP Support | β Planned | SOCKS5 UDP ASSOCIATE |
| Production Crypto | β Planned | FFI to OpenSSL/BoringSSL |
Contributions are welcome! Areas for improvement:
- Production-grade crypto - Replace simplified AEAD with FFI to OpenSSL
- VMess protocol - Implement or integrate v2ray-core via FFI
- HTTP proxy - Full HTTP/HTTPS proxy support in raw socket mode
- UDP support - SOCKS5 UDP ASSOCIATE for DNS and QUIC
- Platform integration - System tray, native notifications
- Traffic charts - Visual graphs for connection history
This project is licensed under the MIT License - see the LICENSE file for details.
- Clash project for the protocol specifications
- Flutter team for the amazing framework
- clash-verge-rev for UI/UX inspiration
- Repository: https://github.com/Worthies/Clash
- Issues: https://github.com/Worthies/Clash/issues
- Flutter: https://flutter.dev
- Clash: https://github.com/Dreamacro/clash
Made with β€οΈ using Flutter | Star β if you find this useful!
