1 / 32

Debugging the Web with Fiddler

Debugging the Web with Fiddler. Ido Flatow Senior Architect Microsoft ASP.NET/IIS MVP SELA Group @idoflatow. About Me. Senior Architect, Sela Group Co-author of courses and books Microsoft ASP.NET/IIS MVP Focus on server, web, cloud, and DevOps

rafi
Télécharger la présentation

Debugging the Web with Fiddler

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Debugging the Web with Fiddler Ido Flatow Senior Architect Microsoft ASP.NET/IIS MVP SELA Group @idoflatow #devconnections

  2. About Me • Senior Architect, Sela Group • Co-author of courses and books • Microsoft ASP.NET/IIS MVP • Focus on server, web, cloud, and DevOps • Manager of the Israeli WebDev User Group

  3. Meet Fiddler…

  4. Fiddler Facts • A proxy server • An HTTP/HTTPS Sniffer • An HTTP Debugger • Written in .NET / Mono • A free utility (for now, cross your fingers) • An extensible application • A must tool for web developers • Unfortunately, it doesn’t make coffee!

  5. How Fiddler Works…

  6. Fiddler by Scenarios Debugging Traffic Inspection Performance Tuning Testing

  7. Scenario: Inspecting Traffic

  8. The Sessions List Customizable Columns Manual comments Response size Sequence and color coding Caching information Origin process

  9. Fiddler to the Rescue • Browsers (Static sites, ASP.NET, J2EE, PHP) • Desktop applications that use HTTP • Web services • Windows Phone Emulator • Any device that supports a proxy server ( )

  10. The Right Inspector for the Job

  11. Filter by… By specific process By host By process name/PID/svchost By URL By status code By MIME or size By process type QuickExec

  12. Fiddler and HTTPS • HTTPS is secured - between two machines • Fiddler acts as a “machine-in-the-middle” • Generates certificates for web sites on-the-fly • Fiddler supports client certificates for authentication • Supports excludingproblematic HTTPS sites

  13. Scenario: Performance Tuning

  14. Understanding the Connection First connection From client to Fiddler Second connection From Fiddler to the server

  15. Visualize the Traffic with Timeline End Start Bar = begin receive Disk = cached response Red = new connection Green = reused connection Bar color = MIME Stripes = buffered by Fiddler Prefer stream over buffer. Use buffer when editing responses

  16. Statistics are Important • Single page statistics give info on performance • Client processing • Server processing • Network latency • Server time: ServerBeginResponse – ServerGotRequest • Upload time: ServerGotRequest – ClientDoneRequest • Download time: ServerDoneResponse – ServerBeginResponse • Watch out for misleading connection reuse • Add timer columns instead of calculating

  17. Performance-related inspectors • Transformer • Image view • Caching • Cookies • HTML Inspector (3rd party)

  18. Drawing Conclusions • Reduce number of requests • Reduce traffic roundtrips • Reduce the size of requests and responses • Applying compression where needed • Identify non-cached responses • Use Fiddler to improve performance, not to measure it!

  19. Scenario: Debugging

  20. Manipulating Traffic with Rules • Simulate user-agents • Disable sending cache headers • HOSTS file remapping • Custom rules

  21. Play it Again, Sam • Why run the client scenario again, just to resend the request? • Simply click “Replay” • Reissue a single request • Reissue a set of requests • Reissue unconditionally (no cache headers) • Reissue multiple times

  22. Changing Requests with Composer • Create any request from scratch • Use previous requests with drag-n-drop • Use Scratchpad to store common requests www.bobthebuilder.com

  23. Breakpoints – Human in the Middle • Manual control over request & response • Stop on any direction • Manipulate headers and body • Use built-in responses or file

  24. Debugging Localhost • In some cases, proxies are bypassed when using localhost (127.0.0.1) addresses • What to do? • Use the machine’s name • Use fictitious DNS names • localhost. or localhost.fiddler(converted to localhost) • ipv4.fiddler or ipv6.fiddler (converted to 127.0.0.1 / [::1])

  25. Debugging Services • Fiddler hooks to the interactive user • IIS App Pools and Windows Services runs using built-in users • Use network sniffers and export as PCAP • Download PsExec and run: PsExec.exe -i -u "nt authority\network service" "%ProgramFiles(x86)%\Fiddler2\Fiddler.exe"

  26. If You See This, Don’t Panic When Fiddler crashes proxy setting are still in effect Before rebooting your machinetry running Fiddler again

  27. Scenario: Testing

  28. “My Code is Perfect” • Save traffic to file • Save sessions as .SAZ (Zip) archive • .SAZ stores content and session info • Other archiving options: • HTTP Archive (HAR) • Visual Studio Web Test

  29. Auto-Responder - an In-Memory Website • If URI matches… then respond with… • Respond with file/redirection/breakpoint/drop • Not only that, you can also: • Import sessions as responses • Edit stored responses • Use original latency time (updatable) • Export and import rules

  30. Fiddler is More Than a Sniffer • Monitors traffic, yes, but also… • Controls traffic • Modifies traffic • Generates traffic • Easy to use • Extensible Enhance your web debugging with Fiddler today!

  31. Resources Fiddler Website http://www.telerik.com/fiddler Fiddler Forum http://groups.google.com/group/httpfiddler Fiddler Blog http://www.telerik.com/automated-testing-tools/blog/eric-lawrence.aspxhttp://blogs.msdn.com/b/fiddler (older blog) My Info This Presentation http://bit.ly/flatowblog@IdoFlatow idof@sela.co.il http://1drv.ms/1kuiuGh

  32. Rate with Mobile App: Rate This Session Now! Tell Us What You Thought of This Session Select the session from the Agenda or Speakers menus Select the Actions tab Click Rate Session Be Entered to WIN Prizes! Rate Using Our Website: Register at www.devconnections.com/logintoratesession Go to www.devconnections.com/ratesession Select this session from the list and rate it

More Related