private void BeforeRequestCallback(Session oSession) { string url = oSession.url.ToLower(); if (url.Contains("microsoft.com") && (url.Contains("/meet/") || url.Contains("/lwa/") || url.Contains("/ucwa/") || url.Contains("/datacollabweb/") || url.Contains("/reach/") || url.Contains("/webticket/"))) { lock (_sessionLock) { NetworkSession session = new NetworkSession(oSession); _sessions[oSession] = session; // In order to enable response tampering, buffering mode must // be enabled; this allows FiddlerCore to permit modification of // the response in the BeforeResponse handler rather than streaming // the response to the client as the response comes in. oSession.bBufferResponse = true; _uiDispatcher.Invoke(new FireSessionStartMethod(FireSessionStart), session); } } if ((oSession.hostname == sSecureEndpointHostname) && (oSession.port == 7777)) { oSession.utilCreateResponseAndBypassServer(); oSession.oResponse.headers.HTTPResponseStatus = "200 Ok"; oSession.oResponse["Content-Type"] = "text/html; charset=UTF-8"; oSession.oResponse["Cache-Control"] = "private, max-age=0"; oSession.utilSetResponseBody("<html><body>Request for https://" + sSecureEndpointHostname + ":7777 received. Your request was:<br/><plaintext>" + oSession.oRequest.headers.ToString()); } }
public NetworkLoggerSessionUpdatedEventArgs(NetworkSession session) { this.Session = session; }