Fiddler plug-in development

Source: Internet
Author: User

Fiddler plug-in development

There is such an application scenario:

If you are developing a front-end or APP, you need to call the interface provided by the server. The interface can only be accessed within the company's Intranet, and code debugging cannot be performed outside the company.

What should I do if I want to access the website outside the company?

If you save the response content of all interfaces in your company, you can simulate a server environment locally from the server, in this way, you can debug the code without the limitations of the network environment.

 

The implementation principle is as follows:

Use Fiddler to capture packets and capture all the interfaces you need to save (not only restricted interfaces, html, css, js, and image.

In Fiddler, choose File> Save> All Sessions from the following menu, and Save All requests as a saz File.

The saz file contains all the information about the request/response. It is a zip file. The following files are named in the raw directory, for example:

002.16c.txt0000002.16s.txt, 0020.m.xml

001 indicates the request serial number, for example, 001,002,003

002.16c.txt is the complete information of the HTTP request (including the request header)

002.16s.txt is the complete information of the HTTP response (including the response header)

00w.m.xml is related to the Fiddler Session (not used in this example)

 

With the request/response information, we can write a Fiddler plug-in to replace all the requests matching in saz with the corresponding response, so as to implement the offline browsing function.

The code is relatively simple and I will not post it. The complete code will be downloaded later.

Plug-in usage:

 

Download source code: Click to download

Related Article

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.