Skip to content

Instantly share code, notes, and snippets.

@wcoder
Last active July 14, 2021 15:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wcoder/a79ffdfb400b2db2d3214d4118c84d79 to your computer and use it in GitHub Desktop.
Save wcoder/a79ffdfb400b2db2d3214d4118c84d79 to your computer and use it in GitHub Desktop.
  1. Fiddler -> Options -> Connections -> 8888
  2. ipconfig -> 192.168.0.2 (fiddler machine IP)
  3. Android Emulator -> Settings -> APN -> Proxy -> 192.168.0.2
  4. .NET layer:
var handler = new HttpClientHandler
{
    UseProxy = true,
    Proxy = new WebProxy("192.168.0.2", 8888)
};

var client = new HttpClient(handler);
public class Proxy : System.Net.IWebProxy
{
public System.Net.ICredentials Credentials
{
get;
set;
}
private readonly Uri _proxyUri;
public Proxy(Uri proxyUri)
{
_proxyUri = proxyUri;
}
public Uri GetProxy(Uri destination)
{
return _proxyUri;
}
public bool IsBypassed(Uri host)
{
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment