For study purposes I tried to make a simple app to learn capturing web traffic. but it didn't capture any traffic. Can you help me to figure out what is wrong here:
void Start()
{
FiddlerApplication.Prefs.SetBoolPref("fiddler.certmaker.CleanupServerCertsOnExit", true);
FiddlerCoreStartupSettings startupSettings =
new FiddlerCoreStartupSettingsBuilder()
.ListenOnPort(8888)
.DecryptSSL()
.OptimizeThreadPool()
.Build();
CertMaker.createRootCert();
FiddlerApplication.Startup(startupSettings);
FiddlerApplication.AfterSessionComplete += FiddlerApplication_AfterSessionComplete;
}
private void FiddlerApplication_AfterSessionComplete(Session oSession)
{
string reqHeaders = oSession.oRequest.headers.ToString();
var reqBody = Encoding.UTF8.GetString(oSession.RequestBody);
string respHeaders = oSession.oResponse.headers.ToString();
var respBody = Encoding.UTF8.GetString(oSession.ResponseBody);
string output = reqHeaders + "\r\n" +
(!string.IsNullOrEmpty(reqBody) ? reqBody + "\r\n" : string.Empty) +
"==========================================================" + "\r\n\r\n" +
respHeaders + "\r\n" +
(!string.IsNullOrEmpty(respBody) ? respBody + "\r\n" : string.Empty) +
"==========================================================" + "\r\n\r\n";
BeginInvoke(new Action<string>((text) =>
{
textBoxTraffic.AppendText(text);
}), output);
}