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