fiddler_network_override 0.0.1
fiddler_network_override: ^0.0.1 copied to clipboard
A Flutter plugin to globally override Dart HttpClient and route HTTP traffic through a configurable proxy, enabling seamless debugging with tools like Fiddler Everywhere. Supports dynamic proxy config [...]
π΅οΈββοΈ fiddler network override #
A Flutter plugin to intercept and route all HTTP traffic through a custom proxy like Fiddler Everywhere, Charles Proxy, or Burp Suite for easy debugging and QA testing.
β¨ Features #
- Globally override Dart
HttpClientto route HTTP(S) traffic through a proxy. - Load proxy configuration from:
- External JSON config file (optional)
- SharedPreferences with a built-in UI for manual input
- Simple bottom sheet UI to configure proxy:
- Host & Port inputs with validation
- Enable/disable toggle
- Save & soft restart app to apply changes
- Cross-platform support (Android, iOS, macOS, Windows, Linux)
- No recompilation needed to change proxy after initial setup
π Why Use fiddler? #
- Debug API calls by routing traffic through intercepting proxies
- Quickly enable/disable proxy on devices without rebuilds
- Useful for QA teams to test apps with various proxies
- Inspect, modify, and replay network requests easily
π¦ Installation #
Add to your pubspec.yaml:
dependencies:
fiddler_network_override: ^0.0.1
π― Usage #
To show the proxy configuration UI anywhere in your app:
showProxyInputSheet(context);
This sheet lets testers input the proxy host and port, toggle enable/disable, and save.
π Proxy Configuration Sources #
1οΈβ£ External JSON File (Optional) #
Path: /storage/emulated/0/root/fiddler/config.json
Example JSON format:
{
"proxy": "192.168.1.9:8866"
}
β οΈ Requires external storage read permission on Android.
2οΈβ£ SharedPreferences (Recommended) #
Proxy details stored under keys:
fiddler_proxy=host:portfiddler_enabled=trueorfalse
Managed via the Proxy Input Sheet UI.
π§ How It Works #
- On app start,
enableFiddlerIfConfigured()checks if proxy is enabled. - If yes, fetches proxy from shared prefs or external file.
- Sets
HttpOverrides.globalto customFiddlerNetworkOverride. - All Dart HTTP clients route through the proxy.
π± Proxy Input Sheet Features #
- Validates host (IP or domain) and port inputs
- Enable/disable proxy toggle switch
- Save & Restart button to apply new settings
- Works on Android and iOS with consistent design
π Permissions #
-
External JSON config file:
- Requires
READ_EXTERNAL_STORAGEpermission on Android. - Not recommended for production apps.
- Requires
-
SharedPreferences config:
- No extra permissions required.
π₯ Platform Support #
| Platform | Status | Notes |
|---|---|---|
| Android | β | Fully supported |
| iOS | β | Fully supported |
| macOS | β | Dart HttpClient only |
| Windows | β | Dart HttpClient only |
| Linux | β | Dart HttpClient only |
| Web | β | HttpOverrides not supported |
β οΈ Limitations & Notes #
- Only affects Dart HttpClient-based HTTP requests.
- Popular libraries like
dioorhttpmust be configured to use Dart HttpClient internally. - Does not affect Web platform due to Flutter Web limitations.
- Proxy must be a valid and reachable address, or requests may fail.
- App restart required to fully apply new proxy settings.
π‘ License #
This project is licensed under the MIT License β see the LICENSE file for details.
π‘ Future Enhancements #
- Soft restart without app exit
- Support for proxy authentication
- Certificate pinning and trust management
- UI improvements and dark mode support
π€ Contributing #
Contributions are welcome! Feel free to open issues or pull requests.
To run example app:
cd example
flutter run
π€ Author #
Chandan Kumar Singh β GitHub | Email
Thank you for using fiddler_network_override! If you find this plugin useful, please βοΈ star the repo and share with your peers.