| description | How to use Proxyman to capture HTTPS traffic. Works with iOS and Android Devices and Simulators |
|---|
{% hint style="success" %} From Proxyman 6.4.0 or later, or Windows/Linux 3.7.0 or later {% endhint %}
Proxyman can capture HTTPS from your Flutter app on the Android Emulator in 1 click. No need to modify your Flutter code, like the old solution.
- Start Proxyman -> Certificate Menu -> Install Certificate for Android -> Emulators
- Make sure set up your Android Emulator first, and the Android must is Google APIs.
Refer automatic-script-for-android-emulator.mdto understand how to set up your Android Emulators
- Check "Install Proxyman VAN to Android Emulators"
- Click "Override All Emulators"
Capture https from Flutter app Android Emulator with Proxyman
- New Terminal will open and execute our bash script to override your Emulators.
- When it's done, a New VPN App is installed to your Emulators
- Click to the VPN button to start it -> Done ✅
- Try to open your Flutter app, and make HTTPS Requests, Proxyman will capture it ✅
{% hint style="warning" %} Old solution works with Proxyman macOS 6.3.0 and earlier, Windows/Linux 3.6.0 and earlier {% endhint %}
Flutter does not use the system-level proxy, so if you use Proxyman, you might not see any traffic from your Flutter Project.
The good news is that you can work around this issue by manually configuring Flutter’s HTTP client to use Proxyman as its proxy.
In general, we have to manually configure the HTTP Client to proxy all traffic to Proxyman Proxy Server, which is listening at IP = localhost, port = 9090.
Depending on which HTTP client you’re using, the steps will be slightly different. We will cover some popular HTTP Clients:
- Dart’s HttpClient class
- The http package
- Dio
If you're using an Android Emulator or an iOS Simulator, you can use String proxy = 'localhost:9090'. Otherwise, please use String proxy = '<YOUR_LOCAL_IP>:9090' on Android Physical Devices.
You can find the <YOUR_LOCAL_IP> from the Proxyman -> Certificate menu -> Install for iOS -> Physical Device
Use current IP
Depending on the network library that your Flutter is using, please follow the settings below:
// Make sure to replace <YOUR_LOCAL_IP> with
// the external IP of your computer if you're using Android.
// You can get the IP in the Android Setup Guide window
String proxy = Platform.isAndroid ? '<YOUR_LOCAL_IP>:9090' : 'localhost:9090';
// Create a new HttpClient instance.
HttpClient httpClient = HttpClient();
// Hook into the findProxy callback to set
// the client's proxy.
httpClient.findProxy = (uri) {
return "PROXY $proxy;";
};
// This is a workaround to allow Proxyman to receive
// SSL payloads when your app is running on Android
httpClient.badCertificateCallback = (cert, host, port) => true;// Make sure to replace <YOUR_LOCAL_IP> with
// the external IP of your computer if you're using Android.
// You can get the IP in the Android Setup Guide window
String proxy = Platform.isAndroid ? '<YOUR_LOCAL_IP>:9090' : 'localhost:9090';
// Create a new HttpClient instance.
HttpClient httpClient = HttpClient();
// Hook into the findProxy callback to set
// the client's proxy.
httpClient.findProxy = (uri) {
return "PROXY $proxy;";
};
// This is a workaround to allow Proxyman to receive
// SSL payloads when your app is running on Android.
httpClient.badCertificateCallback = (cert, host, port) => true;
// Pass your newly instantiated HttpClient to http.IOClient.
IOClient myClient = IOClient(httpClient);
// Make your request as normal.
final response = myClient.get('/my-url');// Make sure to replace <YOUR_LOCAL_IP> with
// the external IP of your computer if you're using Android.
// You can get the IP in the Android Setup Guide window
String proxy = Platform.isAndroid ? '<YOUR_LOCAL_IP>:9090' : 'localhost:9090';
// Create a new Dio instance.
Dio dio = Dio();
dio.httpClientAdapter = IOHttpClientAdapter(
createHttpClient: () {
final client = HttpClient();
client.findProxy = (uri) {
return 'PROXY $proxy';
}
client.badCertificateCallback = (cert, host, port) => true;
return client;
},
validateCertificate: (cert, host, port) {
return true;
},
); // Make sure to replace <YOUR_LOCAL_IP> with
// the external IP of your computer if you're using Android.
// You can get the IP in the Android Setup Guide window
String proxy = Platform.isAndroid ? '<YOUR_LOCAL_IP>:9090' : 'localhost:9090';
// Create a new Dio instance.
Dio dio = Dio();
// Tap into the onHttpClientCreate callback
// to configure the proxy just as we did earlier.
(dio.httpClientAdapter as DefaultHttpClientAdapter).onHttpClientCreate = (client) {
// Hook into the findProxy callback to set the client's proxy.
client.findProxy = (url) {
return 'PROXY $proxy'?;
};
// This is a workaround to allow Proxyman to receive
// SSL payloads when your app is running on Android.
client.badCertificateCallback = (X509Certificate cert, String host, int port) => true;
}- Start your iOS Simulator from Flutter
- On Proxyman -> Certificate menu -> Install Certificate for iOS -> Simulators
- Follow all steps below
Install & trust Proxyman certificate to your iOS Simulators
- ✅ Done. Proxyman can capture your HTTPS.
- Follow this Setup Guide
- Follow this Setup Guide
- Follow this Setup Guide
Credit to James Dixon from https://flutterigniter.com/debugging-network-requests/


.jpg)
.jpg)