Search code examples
androidfiddlerflutter

Flutter app not using Fiddler proxy


I just started playing around with Flutter, and am now trying to do some simple HTTP(s) requests. I've always used Fiddler with proxy to debug requests send from android apps, but the requests send from Flutter don't seem to show.

Is there any way I can get Fiddler to show Flutter requests, or is there some other HTTP Requests debugging tool/monitor I can/should use?


Solution

  • I did some more tests with Drony and I got it to work. Still one problem, I couldn't send HTTPS requests anymore since Dart/Flutter doesn't have an easy way to trust all SSL certificates. I could debug HTTP requests at this point.

    My API only support HTTPS requests, so in my Flutter app I request the HTTP version and I forward it to the HTTPS API via Fiddler: (following code goes in the OnBeforeRequest function)

        if (!oSession.isHTTPS && oSession.HostnameIs("api.xxxx.me")){
            oSession.fullUrl = "https://" + "api.xxxx.me" + oSession.PathAndQuery;
        }