Flutter

How to use Proxyman to capture HTTPS traffic. Works with iOS and Android Devices and Simulators

✅ 1. New Solution

circle-check

Android Emulators

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.

  1. Start Proxyman -> Certificate Menu -> Install Certificate for Android -> Emulators

  2. Make sure set up your Android Emulator first, and the Android must is Google APIs.

Refer Automatic Script for Android Emulatorto understand how to set up your Android Emulators

  1. Check "Install Proxyman VAN to Android Emulators"

  2. Click "Override All Emulators"

capture https from Flutter app Android Emulator with Proxyman
Capture https from Flutter app Android Emulator with Proxyman
  1. New Terminal will open and execute our bash script to override your Emulators.

  2. When it's done, a New VPN App is installed to your Emulators

  3. Click to the VPN button to start it -> Done ✅

  4. Try to open your Flutter app, and make HTTPS Requests, Proxyman will capture it ✅

Local VPN, routes all traffic to Proxyman app. Works with Flutter, React Native apps

⚠️ 2. Old Solution

circle-exclamation

2.1 Problem

Flutter does not use the system-level proxyarrow-up-right, 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.

1. Set up Flutter (Required for all platforms - iOS & Android)

Depending on which HTTP client you’re using, the steps will be slightly different. We will cover some popular HTTP Clients:

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:

Dart HTTPClient Class

HTTP Package

Dio < v5.0.0 (Deprecated APIs)

2. Flutter with iOS Simulators

  1. Start your iOS Simulator from Flutter

  2. On Proxyman -> Certificate menu -> Install Certificate for iOS -> Simulators

  3. Follow all steps below

Install & trust Proxyman certificate to your iOS Simulators
  1. ✅ Done. Proxyman can capture your HTTPS.

3. Flutter with iOS Devices

4. Flutter with Android Emulator

5. Flutter with Android Devices

Credit & Reference

Credit to James Dixon from https://flutterigniter.com/debugging-network-requests/arrow-up-right

Last updated