Setup Proxy for Xamarin development
1 min readApr 7, 2019
The short collection of fast steps about setup HTTP Proxying for iOS and Android development with Xamarin
Charles Proxy
- Setup for Android: The Android Emulator and Charles Proxy: A Love Story
- Setup for iOS: https://medium.com/@wcoder/charles-proxy-setup-for-ios-3c8cb69cd69
- More: Charles Proxy Mobile Guide
Fiddler
Xamarin specific
- If you use the native (AndroidClientHandler, NSUrlSession) HTTP handler, then nothing needs to be done.
- If you use HTTP handler by default (managed), follow above:
Setup the proxy with a custom HttpClientHandler
:
var handler = new HttpClientHandler
{
// local ip, charles port
Proxy = new WebProxy("192.168.0.52", 8888)
};
Then use it whenever you create an HttpClient
in your app
var client = new HttpClient(handler);
// TODO: make some requests to test charles!