The latest FiddlerCoreAPIFreeSetup, capture the new dll file, use it after installation, Fiddler's http custom interception processing library, FiddlerCore is currently available as a .NET class library, which can be used by any .NET application. FiddlerCore is designed for dedicated applications that run without a user interface, such as test automation, or UIs specifically for UIs that Fiddler Addon doesn't fit in, such as WPF traffic visualization.
FiddlerCore has now switched to paid, but before the charge, several new versions of .NET standard were released in beta, which were available and did not have a 30-day limit. The full SDK and demo are available. The download address is as follows:
Create a new .NET 4.6.2 console project: HttpCapture, which references the FiddlerCore45.dll class library, which can be obtained by downloading it as above.
The Fiddler event is as follows:
// Summary: // This event fires when a session has been completed public static event SessionStateHandler AfterSessionComplete; // Summary: // This event fires when Fiddler captures a WebSocket message public static event EventHandler<WebSocketMessageEventArgs> OnWebSocketMessage; [CodeDescription("This event fires a HTTPS certificate is validated.")] public static event EventHandler<ValidateServerCertificateEventArgs> OnValidateServerCertificate; // Summary: // This event fires when Response Headers are available public static event SessionStateHandler ResponseHeadersAvailable; // Summary: // This event fires when Request Headers are available public static event SessionStateHandler RequestHeadersAvailable; // Summary: // This event fires when a server response is received by Fiddler public static event SessionStateHandler BeforeResponse; // Summary: // This event fires when a client request is received by Fiddler public static event SessionStateHandler BeforeRequest; // Summary: // This event fires each time FiddlerCore reads data from network for the client's // request. Note that this data is not formatted in any way, and must be parsed // by the recipient. public static event EventHandler<RawReadEventArgs> OnReadRequestBuffer; // Summary: // This event fires each time FiddlerCore reads data from network for the server's // response. Note that this data is not formatted in any way, and must be parsed // by the recipient. public static event EventHandler<RawReadEventArgs> OnReadResponseBuffer; [CodeDescription("This event fires when the user instructs Fiddler to clear the cache or cookies.")] public static event EventHandler<CacheClearEventArgs> OnClearCache; // Summary: // Sync this event to be notified when FiddlerCore has attached as the system proxy.")] [CodeDescription("Sync this event to be notified when FiddlerCore has attached as the system proxy.")] [Obsolete("Please, use the Telerik.NetworkConnections.NetworkConnectionsManager.")] public static event SimpleEventHandler FiddlerAttach; // Summary: // Sync this event to be notified when FiddlerCore has detached as the system proxy. [CodeDescription("Sync this event to be notified when FiddlerCore has detached as the system proxy.")] [Obsolete("Please, use the Telerik.NetworkConnections.NetworkConnectionsManager.")] public static event SimpleEventHandler FiddlerDetach; [CodeDescription("This event fires when a user notification would be shown. See CONFIG. QuietMode property.")] public static event EventHandler<NotificationEventArgs> OnNotification; // Summary: // This event fires when an error response is generated by Fiddler public static event SessionStateHandler BeforeReturningError; // Summary: // Fired each time Fiddler successfully accepts a TCP/IP connection public static event EventHandler<ConnectionEventArgs> AfterSocketAccept; // Summary: // Fired each time Fiddler successfully establishes a TCP/IP connection public static event EventHandler<ConnectionEventArgs> AfterSocketConnect; Commonly used events are BeforeRequest, BeforeResponse, and AfterSessionComplete.
If you want to block HTTPS requests, you need to install a certificate, the code is as follows:
Attached is the code to determine if the certificate exists:
The results we achieved were as follows:
1. Interceptwww.itsvse.comSite request, which returns a piece of JSON content directly. 2. Block the down.itsvse.com site, and after the response, replace the string "Uploaded by" with "Uploaded by"
The code is as follows:
Then set the ie agent 127.0.0.1:9099 manually, also with the code settings, as follows:
The renderings are as follows:
Note: When modifying the content after the response, you need to set up a session in the BeforeRequest eventsession.bBufferResponse = true;, otherwise you can't modify the response content!
Source code download:
Tourists, if you want to see the hidden content of this post, please Reply
(End)
|