Sample maui app built to demonstrate using a proxy such as Charles to debug web requests from a maui app.
The sample app is not fully implemented yet, currently only films has any ui to show the api call result. Api calls are extremely slow so I have implemented a caching layer using Microsoft.Extensions.Caching
to save web results.
- You must have charles proxy setup on your machine.
- Ensure all urls are correct (these might be different for my machine than yours), ensure
<UseProxy>true</UseProxy>
(set tofalse
to test app without traffic inspection). - Build & run
There is some jank with the iOS implementation. You cannot use the native NSURLSessionHandler
in maui (this did work in Xamarin), see this issue. Instead you have to use the dotnet handler, this is quite annoying and essentially makes adding proxies as a feature to iOS maui apps dead until this gets changed.
The iOS proxy code changes are automatically handled in this sample, see the csproj & conditional compile.
Setup your emulator as described in this guide.
There is no other code changed needed to get traffic inspection working.