WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Worthies/Clash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

27 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Clash

A fully functional cross-platform Clash proxy tool built with Flutter πŸš€

Home page

Flutter Dart License Platform

🎯 Overview

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.

✨ Key Features

πŸ” Working Proxy Protocols

  • βœ… 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)

πŸ“± Complete User Interface (8 Pages)

  1. Home - Dashboard with traffic monitor and system status
  2. Proxies - Node management with speed testing and group support
  3. Profiles - Subscription management with YAML parsing
  4. Connections - Real-time connection monitoring
  5. Rules - Routing rules display
  6. Logs - Application logs with filtering
  7. Test - Batch proxy speed testing
  8. Settings - System configuration

πŸš€ Advanced Capabilities

  • βœ… 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)

πŸ—οΈ Architecture

Protocol Implementations

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)

Core Services

lib/services/
β”œβ”€β”€ clash_state.dart              # State management (Provider)
└── proxy_service.dart            # Local proxy server & connections

Data Models

lib/models/
└── clash_models.dart             # ProxyNode, ProxyGroup, Profile, etc.

UI Pages

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

πŸš€ Getting Started

Prerequisites

  • Flutter 3.35.4 or higher
  • Dart 3.9.2 or higher

Installation

  1. Clone the repository:
git clone https://github.com/Worthies/Clash.git
cd Clash
  1. Install dependencies:
flutter pub get
  1. 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

Quick Test

  1. Launch the app
  2. Go to Profiles page
  3. Add a Clash subscription URL
  4. Activate the profile (parses proxies and groups)
  5. Go to Proxies page
  6. Select a proxy node
  7. Test speed or connect to the proxy
  8. Configure your browser/system to use SOCKS5: 127.0.0.1:1080

πŸ“– Documentation

Comprehensive documentation is available in the /docs directory:

πŸ”§ Configuration

Supported Proxy Types

Trojan

- name: 'My Trojan Server'
  type: trojan
  server: example.com
  port: 443
  password: your-password-here
  sni: example.com
  udp: true
  skip-cert-verify: false

Shadowsocks

- 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.com

Local Proxy Server

The 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

πŸ§ͺ Testing

Run Unit Tests

flutter test

Test with Real Proxy

  1. Load a Clash YAML subscription
  2. Select a Trojan or Shadowsocks node
  3. Click "Connect"
  4. Use a SOCKS5 client to test:
curl --socks5 127.0.0.1:1080 https://ifconfig.me

Speed Testing

  • 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

πŸ“¦ Dependencies

Production

  • 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

Development

  • flutter_test: SDK - Testing framework
  • flutter_lints: ^4.0.0 - Code quality

🎨 Features in Detail

Traffic Monitor Panel

  • 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)

Proxy Management

  • 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

Subscription Support

  • 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

Connection Monitoring

  • View active connections in real-time
  • Per-connection traffic statistics
  • Source/destination information
  • Protocol and network type display

πŸ” Security Features

  • βœ… 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

🚧 Implementation Status

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 ⚠️ Limited 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

🀝 Contributing

Contributions are welcome! Areas for improvement:

  1. Production-grade crypto - Replace simplified AEAD with FFI to OpenSSL
  2. VMess protocol - Implement or integrate v2ray-core via FFI
  3. HTTP proxy - Full HTTP/HTTPS proxy support in raw socket mode
  4. UDP support - SOCKS5 UDP ASSOCIATE for DNS and QUIC
  5. Platform integration - System tray, native notifications
  6. Traffic charts - Visual graphs for connection history

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Clash project for the protocol specifications
  • Flutter team for the amazing framework
  • clash-verge-rev for UI/UX inspiration

πŸ”— Links


Made with ❀️ using Flutter | Star ⭐ if you find this useful!

About

A cross-platform Clash tool built on FlutterπŸŽ‰πŸŽ‰πŸŽ‰

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •