Use Fiddler to watch infoq videos
By Jeffrey Zhao, 1833 visits, network Abstract, favorites, Edit
Infoq is a good place, and I think the most valuable resource is the speech video. Infoq has a feature in this regard: a clear slide is provided below the speech video, while the slides are switched Based on the progress while being played. This viewing experience is naturally much higher than the simple speech video. Unfortunately, some people sometimes tell me that infoq is too slow to watch videos smoothly. Since infoq won't release CDN in China at half past one, the speed of video loading ...... Almost no solution. Fortunately, if we leave for the second place, at least we can use tools such as fiddler to "ease" the problem.
About fiddler
Fiddler is a free HTTP debugging tool fully developed by Eric Lawrence using. net. Later, after Microsoft connected the tool and acquired it together, it was also made as a product. Fiddler does not perform network sniffing during work. It serves as a "Proxy Server" function, and any software only needs to use this proxy, fiddler can intercept all requests sent by it for tracking, viewing, and even more advanced work we will see in a moment. For more information about Fiddler, you can follow Eric Lawrence's speech in PDC 09.
With Fiddler, I almost no longer need firebug's net function, because it has limited functionality and can only run based on Firefox. Due to how fiddler works, it can be used in any tool that uses a proxy server. Of course, the working principle of Fiddler also makes it unable to obtain some information. For example, firebug can get the waiting time of a request in the browser, or the DNS resolution time-while fiddler can only track the situation after the request is initiated.
Fiddler also supports extensions, making it easy to compile fiddler extensions. Fiddler also provides core class libraries such as fiddlercore, allowing our programs to provide sniffing functions such as fiddler. However, these topics are beyond the scope of this article. We only use the built-in functions of Fiddler this time.
Download video
How can we use Fiddler to watch infoq videos? Because the online video viewing speed is very slow, we naturally think that it is okay to download it to a local place and then watch it again. Generally, such online videos request a FLV file, and the path of this file can be easily obtained using Fiddler.
For example, you can open Fiddler, set the proxy server in the browser (which may have been set automatically), and then open the statically dynamic typing video in infoq, after loading the generation page, click the play button of the video. Therefore, Fiddler can intercept the following requests:
The last request intercepted is a FLV file. You can right-click the file and select copy-Just URL to copy the complete address of the file. Then, you can use the download tool or any method to download the file to your local disk. This is the first step.
Set filter conditions
For video playback on some sites, you can view the downloaded files directly. However, for infoq videos, if you play them locally, you cannot enjoy the "slide" synchronization function. Naturally, we hope that our local files can be used on the video playback page. However, this is the next step. Now let's do another thing: Set the filter conditions for Fiddler.
Because the principle of Fiddler is to intercept all requests through itself (that is, the proxy), sometimes it will get a lot of unnecessary information. For example, after we set up a proxy server in Internet Options, all IE or chrome pages, or even MSN, or the requests sent by using WebClient or webrequest when you write your own program, this proxy is used. At this time, you will find that the requests in Fiddler are confidential and will continue to grow, which will greatly affect debugging.
In this case, you can set a filter condition to tell fiddler that only requests meeting specific conditions are captured. It is not difficult to set filter conditions. fiddler provides a small process filter icon (for example). You can drag it to a program window so that only requests sent by that process will be captured. However, this operation is sometimes inconvenient because, for example, the current browser, such as IE 8 or chrome, has multiple tabs, and each tab belongs to a different process. During drag-and-drop, it is very likely that the cloud will crash. Therefore, here we manually set the filter conditions:
First of all, the result is still, but we drag the horizontal scroll bar to the right, you can find that in the process column, the text "chorme: 6764" is written, which indicates the name and PID of the process. Therefore, we can set it as a unique filter condition in the filter column of Fiddler:
Try again to see if fiddler only intercepts the request sent by the tab?
Set breakpoints
Everything is ready. The last step is to let fiddler convert the original request to the remote FLV file into a local request. This allows you to use the fiddler breakpoint function.
Since fiddler interrupts all captured requests, we must reduce the number of captured requests. For example, setting the filter condition to a video playback page is a good choice. If you have set filtering conditions, you can open the playback page (but do not play back), and then clear the captured information in Fiddler. Then, set the breakpoint:
Select before requests. In this way, the fiddler will pause after obtaining the request information and wait for further processing (you can click to enlarge the image ):
Then, we only need to select choose response-find a file:
Then select the file we downloaded to the local device and click "run to completion. However, after you start playing the video, remember to disable the fiddler breakpoint. Otherwise, the page will be paused by the fiddler when switching the slide-this is not good.
Summary
Check whether the video is smooth now? Fiddler actually has many useful functions. It can be said that it is a necessary tool for "web-related" developers. The development of Fiddler is also rapid, and it also has very powerful scalability. If your project needs a sniffing function similar to Fiddler, you may wish to explore it.