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 config the HTTP Client to proxy all traffic to Proxyman Proxy Server, which is listening at IP = localhost, port = 9090.
1. Setup Flutter (Required to 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 Android Emulator or 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
1.1 Dart HTTPClient Class
// 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 windowString proxy =Platform.isAndroid?'<YOUR_LOCAL_IP>:9090':'localhost:9090';// Create a new HttpClient instance.HttpClient httpClient =newHttpClient();// 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 AndroidhttpClient.badCertificateCallback= ((X509Certificate cert,String host,int port) =>true);
1.2 HTTP Package
// 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 windowString proxy =Platform.isAndroid?'<YOUR_LOCAL_IP>:9090':'localhost:9090';// Create a new HttpClient instance.HttpClient httpClient =newHttpClient();// 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= ((X509Certificate cert,String host,int port) =>true);// Pass your newly instantiated HttpClient to http.IOClient.IOClient myClient =IOClient(httpClient);// Make your request as normal.var response =myClient.get('/my-url');
1.3 Dio
// 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 windowString 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;}
2. Flutter with iOS Simulators
Start your iOS Simulator from Flutter
On Proxyman -> Certificate menu -> Install Certificate for iOS -> Simulators