This paper mainly introduces the principle and method of implementing the offline browsing function of the C # Fiddler plug-in. Have a good reference value, follow the small series together to see it
There is an application scenario:
You do the front-end or app development, you need to invoke the interface provided by the server, the interface can only be accessed within the company intranet, outside the company can not debug code.
What do I do if I want to visit outside the company?
If the response content of all the interfaces is saved at the time of the company, the server-side environment can be simulated out of the server, so that it can not be restricted by the network environment. Pleasant Debugging Code.
The implementation principle is as follows:
Grab the bag with fiddler first, and grab the interface you need to save (not only the interface, Html,css,js,image can).
In Fiddler, click the following menu, file, save, all Sessions, to save all the requests you have caught as a saz file.
The Saz file contains all the request/response information, is a zip file, in the raw directory will have the following named file, for example:
001_c.txt, 001_s.txt, 001_m.xml
001 indicates the request sequence number, for example: 001,002,003
001_c.txt is the complete message for the HTTP request (including the request header)
001_s.txt is the full message of the HTTP response (including the response header)
001_m.xml is the relevant information for the Fiddler session (not available in this example)
With the request/response information, we can write a fiddler plug-in to the saz can be matched to the request is replaced by the corresponding response, so that the offline browsing function.
The code is relatively simple I will not post, there is a full code download.
Next plugin usage:
Unzip the saz to a directory, paste the directory path in the text box, and multiple saz paths are separated by line breaks. In fact here can be made directly paste Saz file path, by the plug-in automatic decompression more convenient; I'm lazy, I didn't do ^_^.
Click "Save"
Now to access the previously grabbed address, will not go to the server.
The above is the C # Fiddler plug-in implementation of the website offline browsing function graphic Introduction, more relevant content please pay attention to topic.alibabacloud.com (www.php.cn)!