Fiddle extension-httpping-check whether Web servers are normal in batches

Source: Internet
Author: User
Tags reflector

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.