To maintain a series of websites for work reasons, you need to test whether the website can be opened normally in a different period of time. One by one URL input, and then press enter to test is too tired, it is also very cumbersome. So I developed this extension. Now I will call it httpping.
First look
Fiddler provides extended interfaces. For more information, see http://www.fiddlertool.com/Fiddler/dev/IFiddlerExtension.asp.
As we all know, the requestbuilder of Fiddler can ping a single website. Of course, I will call the requestbuilder method, which is the best choice.
Reflector view fiddler and findCode
1:/// <Summary>
2:/// Requestbuilder enter the address and press enter to call the method. The core is session. Execute.
3:/// <Summary>
4:Private BoolActsendrequestfromwizard ()
5:{
6:....................
7:Session session =NewSession (httprequestheaders) oheaders. Clone (), bytes );
8:....................
9:Threadpool. unsafequeueuserworkitem (NewWaitcallback (session. Execute ),Null);
10:Return True;
11:}
Copy this method to the extendedProgramSet, OK, session. Execute cannot be found. Continue Reflector
1:Internal VoidExecute (ObjectObjthreadstate)
2:{
3:Try
4:{
5:This. Innerexecute ();
6:}
7:Catch(Exception)
8:{
9:Fiddlerapplication. reportexception (exception,"Uncaught exception in session #"+This. Id. tostring ());
10:}
11:}
12:
The internal method has to continue to look at innerexecute ()
Private VoidInnerexecute (){..........}
OK, reflection call
1:Threadpool. unsafequeueuserworkitem (NewWaitcallback (A => {
2:Session. GetType (). invokemember ("Innerexecute", System. reflection. bindingflags. nonpublic | system. reflection. bindingflags. instance | system. reflection. bindingflags. invokemethod
3:,Null, Session,Null);
4:}),Null);
Compile the DLL, copy it to the scripts directory of Fiddler, and run fiddler and OK.
The code will be uploaded later. Click to download the source code.