How sinalphabeta/flux-v2app works
Flux is a cross-platform Flutter V2Board client: users authenticate against a panel, inspect subscription plans and nodes, manage orders/account details, then connect through a unified VPN service. The connection layer selects platform-specific traffic handling and runs V2Ray/Xray. The README documents the iOS and desktop approaches; platform source excerpts are partial, so uncertain internal wiring is omitted.
Main entry points: v2board_api.dart V2Board API · screens Client screens · platform_service.dart Platform selector · MainActivity.kt Android bridge
Components 23
Client experience
- Flutter app
lib/main.dart - Client screens
lib/screens - User and plan models
lib/models
V2Board services
- API endpoint config
lib/services/api_config.dart - V2Board API
lib/services/v2board_api.dart - Subscription service
lib/services/subscription_service.dart
Connection orchestration
- Unified VPN service
lib/services/unified_vpn_service.dart - Platform selector
lib/services/platform_service.dart - Latency testing
lib/services/latency_test_service.dart
Platform traffic
- Desktop proxy
lib/services/desktop_proxy_service.dart - V2Ray service
lib/services/v2ray_service.dart - Windows V2Ray
lib/services/v2ray_service_windows.dart - Android bridge
android/app/src/main/kotlin/com/flux/app/flux/MainActivity.kt - Android Xray core
android/app/src/main/libs/libv2ray.aar - Android VPN service
android/app/src/main/kotlin/com/flux/app/flux/FluxVpnService.kt - TUN-to-SOCKS
android/app/src/main/kotlin/com/flux/app/flux/FluxVpnService.kt - HEV native bridge
android/app/src/main/kotlin/hev/htproxy/TProxyService.kt - iOS VPN manager
ios/Runner/VPNManager.swift - iOS packet tunnel
ios/Runner/PacketTunnelProvider.swift
Other components
- User
- V2Board panel
- Xray core
assets/bin - System proxy settings
Connections 24
- User → Flutter app: uses
- Flutter app → Client screens: presents
- Client screens → V2Board API: panel requests
- V2Board API → API endpoint config: gets endpoint
- V2Board API → V2Board panel: calls
- V2Board API → User and plan models: maps responses
- Subscription service → V2Board API: fetches subscription
- Client screens → Subscription service: loads subscription
- Client screens → Unified VPN service: requests connection
- Unified VPN service → Platform selector: selects platform
- Unified VPN service → Latency testing: tests node latency
- Platform selector → Desktop proxy: selects desktop proxy
- Platform selector → iOS VPN manager: selects iOS VPN
- Platform selector → Android bridge: selects Android VPN
- Desktop proxy → V2Ray service: starts core
- Desktop proxy → System proxy settings: sets system proxy
- V2Ray service → Xray core: launches core
- Windows V2Ray → Xray core: launches core
- Android bridge → Android Xray core: starts core
- Android bridge → Android VPN service: starts VPN
- Android VPN service → TUN-to-SOCKS: starts forwarding
- TUN-to-SOCKS → HEV native bridge: calls native methods
- Android VPN service → Android bridge: emits status
- iOS VPN manager → iOS packet tunnel: starts tunnel