How xiiifox/flutter_vless works
flutter_vless is a cross-platform Flutter plugin for importing proxy/VPN profiles and running Xray through native backends. The documented user flow is profile input → configuration → permission/start → proxy or tunnel traffic, with status and delay checks. The excerpts show Android session orchestration and Windows mode dispatch; other platform implementations and Dart import/configuration code are not present in the supplied source sample, so those capabilities are represented only where the README supports them.
Main entry points: FlutterVlessPlugin.kt Flutter plugin · XrayCoreManager.kt Xray core · XrayVPNService.kt VPN service · v2ray_manager.cpp Runtime manager
Components 20
Flutter integration
- Flutter plugin
packages/flutter_vless_android/android/src/main/kotlin/com/github/tfox/flutter_vless/FlutterVlessPlugin.kt - Profile import
- Config generation
Android runtime
- VPN service
packages/flutter_vless_android/android/src/main/kotlin/com/github/tfox/flutter_vless/xray/service/XrayVPNService.kt - Xray core
packages/flutter_vless_android/android/src/main/kotlin/com/github/tfox/flutter_vless/xray/core/XrayCoreManager.kt - Runtime config
packages/flutter_vless_android/android/src/main/kotlin/com/github/tfox/flutter_vless/xray/dto/XrayConfig.kt - DNS and access policy
packages/flutter_vless_android/android/src/main/kotlin/com/github/tfox/flutter_vless/xray/core/AndroidTunnelDnsPolicy.kt - Authenticated SOCKS
packages/flutter_vless_android/android/src/main/kotlin/com/github/tfox/flutter_vless/xray/core/AuthenticatedSocksClient.kt - Diagnostics store
packages/flutter_vless_android/android/src/main/kotlin/com/github/tfox/flutter_vless/xray/core/XrayDiagnosticsStore.kt
Windows runtime
- Windows plugin
packages/flutter_vless_windows/windows/flutter_vless_plugin.cpp - Runtime manager
packages/flutter_vless_windows/windows/v2ray_manager.cpp - Proxy service
packages/flutter_vless_windows/windows/proxy_service.cpp - VPN service
packages/flutter_vless_windows/windows/vpn_service.cpp - Traffic protection
packages/flutter_vless_windows/windows/traffic_protection.cpp - Diagnostics log
packages/flutter_vless_windows/windows/diagnostics_log.h
Apple runtime
- iOS plugin
ios/flutter_vless/Sources/flutter_vless/FlutterVlessPlugin.swift - iOS tunnel support
ios/flutter_vless/Sources/flutter_vless_tunnel_support/TunnelRuntimeSupport.swift - macOS plugin
packages/flutter_vless_macos/macos/flutter_vless_macos/Sources/flutter_vless_macos/FlutterVlessPlugin.swift - Packet tunnel
packages/flutter_vless_macos/macos/flutter_vless_macos/Sources/flutter_vless_macos_tunnel_support/FlutterVlessPacketTunnelProvider.swift
Other components
- App developer
Connections 21
- App developer → Flutter plugin: calls API
README.md - App developer → Profile import: provides profile
README.md - Profile import → Config generation: generates config
README.md - Config generation → Flutter plugin: starts runtime
README.md - Flutter plugin → VPN service: dispatches session
- VPN service → Runtime config: accepts config
packages/flutter_vless_android/android/src/main/kotlin/com/github/tfox/flutter_vless/xray/service/XrayVPNService.kt - VPN service → Xray core: restarts workers
packages/flutter_vless_android/android/src/main/kotlin/com/github/tfox/flutter_vless/xray/service/XrayVPNService.kt - Xray core → Runtime config: normalizes config
packages/flutter_vless_android/android/src/main/kotlin/com/github/tfox/flutter_vless/xray/core/XrayCoreManager.kt - Xray core → DNS and access policy: uses policy
packages/flutter_vless_android/android/src/main/kotlin/com/github/tfox/flutter_vless/xray/core/XrayCoreManager.kt - Xray core → Authenticated SOCKS: uses client
packages/flutter_vless_android/android/src/main/kotlin/com/github/tfox/flutter_vless/xray/core/XrayCoreManager.kt - Xray core → Diagnostics store: records diagnostics
packages/flutter_vless_android/android/src/main/kotlin/com/github/tfox/flutter_vless/xray/core/XrayCoreManager.kt - Flutter plugin → Windows plugin: dispatches platform
- Windows plugin → Runtime manager: controls runtime
- Runtime manager → Proxy service: starts proxy
packages/flutter_vless_windows/windows/v2ray_manager.cpp - Runtime manager → VPN service: starts tunnel
packages/flutter_vless_windows/windows/v2ray_manager.cpp - Proxy service → Diagnostics log: appends logs
packages/flutter_vless_windows/windows/proxy_service.cpp - VPN service → Traffic protection: activates protection
- Flutter plugin → iOS plugin: dispatches platform
- iOS plugin → iOS tunnel support: starts tunnel
- Flutter plugin → macOS plugin: dispatches platform
- macOS plugin → Packet tunnel: starts tunnel