A stateless, event-driven Dart wrapper for the Sing-box proxy core β TUN VPN mode, kill switch, Clash API, per-app proxy, and native support for WireGuard, Hysteria2, TUIC, VMess, VLESS, Trojan, Shadowsocks, and more, all in one Flutter plugin.
π Hey Flutter Fam!
If you've been following my journey, you know I shipped flutter_v2ray_client not too long ago β and the community response was absolutely incredible. Thank you! π
But you kept asking me one thing:
"Amir, when are you bringing **sing-box* to Flutter?"*
Well β today is that day. π
I'm beyond excited to introduce flutter_singbox_client β a powerful, modern Flutter VPN plugin and Flutter proxy library that wraps the Sing-box universal proxy core with a clean, stateless, event-driven Dart API.
Whether you're building a censorship-bypass VPN app, a privacy tool, or a custom proxy client in Flutter, this plugin gives you a production-ready foundation. π
π€ Why Sing-box for a Flutter VPN App?
V2Ray and Xray got us far β but the proxy world has evolved dramatically. Sing-box is the new gold standard for proxy cores:
- Broader protocol coverage (WireGuard, Hysteria2, TUIC, etc.)
- Better performance and modern TLS features (uTLS, Reality, ECH)
- Actively maintained open-source community
- Future-proof for years to come
If you're choosing a Flutter VPN library or a Flutter proxy library in 2026, Sing-box is the most future-proof core to build on. π
β¨ Key Features
π VPN Mode β Full device-wide TUN tunnel via Android VpnService
π Proxy Mode β HTTP/SOCKS proxy without a TUN device β no VPN permission required
βοΈ Clash API β Runtime mode switching and outbound group control with latency testing
π± Per-App Proxy β Include or exclude specific apps from the tunnel (split tunneling)
π System Proxy β Register HTTP inbound as device-wide proxy on Android Q+
π Kill Switch β Block all traffic at the OS level when the tunnel is down
π Live Traffic β Real-time upload/download speeds and session totals at ~1 Hz
π Connection Tracking β Full per-connection metadata, lifecycle, and close control
π Live Logs β Real-time Go core log streaming with per-level filtering
β οΈ Fault Alerts β Dedicated fault stream for actionable service errors
π§ Memory Limits β Go runtime soft memory cap (GOMEMLIMIT) with optional connection kill
π§ͺ Network Testing β Built-in STUN (NAT type, latency) and network quality (speed, RPM) tests
β Config Validation β Go core validation and JSON formatting before connecting
π Hot Reload β Reload config without restarting the service or dropping connections
π Boot Auto-start β Boot broadcast relay so your app can reconnect after device restart
π¦ Zero Persistence β No database, no shared preferences, no file I/O for user data
π Supported Protocols
Sing-box's protocol arsenal is unmatched. With flutter_singbox_client you get native support for:
VMess Β· VLESS Β· Trojan Β· Shadowsocks Β· Hysteria2 Β· TUIC Β· WireGuard Β· ShadowTLS Β· AnyTLS Β· Naive Β· Tor Β· SSH
Plus full support for V2Ray transports (WebSocket, gRPC, HTTPUpgrade, QUIC), TLS security (uTLS, Reality, ECH, ACME), FakeIP DNS, rule-based routing, and anti-censorship obfuscation.
π Quick Start
1οΈβ£ Add to Your Project
dependencies:
flutter_singbox_client: ^1.0.0
2οΈβ£ Configure Android
In android/app/build.gradle:
android {
compileSdk 35
defaultConfig { minSdk 23 }
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions { jvmTarget = "17" }
}
3οΈβ£ Initialize
import 'package:flutter_singbox_client/flutter_singbox_client.dart';
final client = SingboxClient();
await client.initialize();
4οΈβ£ Connect
await client.connect(SessionOptions(
config: myConfigJson,
networkMode: NetworkMode.vpn,
killSwitch: true,
notification: NotificationConfig(
title: 'VPN Active',
showTrafficStats: true,
showStopButton: true,
),
));
5οΈβ£ Listen to Events
// Live traffic stats
client.trafficStatsStream.listen((stats) {
print('β ${stats.uplinkBps} bps');
print('β ${stats.downlinkBps} bps');
});
// Connection state
client.serviceStateStream.listen((state) {
print('State: $state');
});
// Faults & errors
client.faultStream.listen((error) {
print('Error: $error');
});
πΈ UI Showcase
Here's a peek at the production-ready example app:
π¨ Real-World Use Cases
Imagine building:
Privacy-First Browsers π‘οΈ β Full TUN tunnel, zero traffic leaks
Secure Messaging Apps π¬ β Proxy layer over end-to-end encryption
Streaming Media Players π₯ β Bypass geo-restrictions with Hysteria2
Corporate VPN Solutions π’ β Split tunneling for enterprise workflows
Censorship-Bypass Tools π β Reality + TUIC for the toughest networks
Developer Proxy Utilities βοΈ β Route debug traffic, inspect connections live
π flutter_singbox_client vs flutter_v2ray_client
Core Engine: flutter_v2ray_client uses Xray, flutter_singbox_client uses Sing-box
Protocols:
- Hysteria2: β Both (v3.2+ in v2ray) vs β Native in singbox
- TUIC: β Not in v2ray vs β In singbox
- WireGuard: β Not in v2ray vs β In singbox
- ShadowTLS / AnyTLS: β Not in v2ray vs β In singbox
- Tor / SSH: β Not in v2ray vs β In singbox
Advanced Features:
- Kill Switch: β Not in v2ray vs β In singbox
- Hot Config Reload: β Not in v2ray vs β In singbox
- Clash API: β Not in v2ray vs β In singbox
- Connection Tracking: β Not in v2ray vs β In singbox
- STUN / Network Test: β Not in v2ray vs β In singbox
- Boot Auto-start: β Not in v2ray vs β In singbox
- System Proxy: β Not in v2ray vs β In singbox
Bottom Line: Both packages are great β but flutter_singbox_client is the evolution. If you're starting a new Flutter VPN project in 2026, this is the one to pick. π
β FAQ
What is flutter_singbox_client?
It's an open-source Flutter plugin that wraps the Sing-box proxy core in a stateless, event-driven Dart API. It lets Flutter developers build VPN and proxy apps with full TUN tunneling, kill switch, per-app proxy, and live traffic monitoring.
Is it free and open source?
Yes! GPL-3.0 on GitHub and pub.dev.
Which protocols does it support?
VMess, VLESS, Trojan, Shadowsocks, Hysteria2, TUIC, WireGuard, ShadowTLS, AnyTLS, Naive, Tor, and SSH β plus V2Ray transports and modern TLS features.
Does it support iOS?
iOS and macOS are in active development. Windows and Linux are planned. Android is fully supported today.
Can I use it in production?
Absolutely! It's built on Sing-box 1.14, supports Android API 23+, and is designed for production use.
Do I need root access?
No. Everything runs in user space through Android's standard VpnService API.
π Tech Stack
Core Engine: Sing-box 1.14.0-alpha.20 (Go)
Android: API 23+ (Marshmallow), 16 KB page size β
Flutter: >= 3.19.0
Dart: >= 3.3.0
Java Target: 17
License: GPL-3.0
πΊοΈ Supported Platforms
Android: β Done
iOS: π§ In Development
macOS: π§ In Development
Windows: π Planned
Linux: π Planned
π Resources
flutter_singbox_client
- π¦ Pub.dev
- π GitHub
- π Getting Started Guide
- π API Reference
flutter_v2ray_client (previous)
π¬ Share Your Thoughts
I'd love to hear from you in the comments:
- Have you used Sing-box before? Which protocol is your go-to?
- Are you building a VPN or proxy app? What features matter most?
- Migrating from flutter_v2ray_client? What convinced you?
- Privacy advocate? What's your biggest challenge when building censorship-bypass tools?
Drop your thoughts below β I read every single comment! π
π Support
If you found this helpful:
- β Star the repo on GitHub
- π’ Share this post with your network
- π¬ Comment with your thoughts and questions
- π React to show your support
Your support means everything! π
Let's build the future of private networking together! π
Follow me for more Flutter VPN/proxy content:
- πΌ LinkedIn
- π¦ X (Twitter)
- βοΈ Telegram
- π Portfolio
For further actions, you may consider blocking this person and/or reporting abuse
