1

I am using ASP.Net + .Net 3.5 + VS 2008 + IIS 7.0 + C# to develop a web application. I want to use Fiddler to debug (i.e. monitor request and response Http traffic) local traffic -- i.e. when I test web application inside VSTS 2008's built-in test ASP.Net web server. Is that feasible? If yes, how to monitor such traffic? For example, in VSTS 2008's built-in ASP.Net test web application server, the Url I want to monitor request traffic sent to http://localhost:1870/Default.aspx and its response (i.e. when F5 is pressed in VSTS 2008).

BTW: I previously think Fiddler could only be used to monitor port 80 Http traffic, not sure whether port 1870 could be monitored?

jessehouwing
  • 106,458
  • 22
  • 256
  • 341
George2
  • 44,761
  • 110
  • 317
  • 455
  • 1
    Does this help? http://stackoverflow.com/questions/1470634/get-http-requests-and-responses-made-using-httpwebrequest-httpwebresponse-to-show/1470730#1470730 – CraigTP Jul 18 '10 at 13:12
  • Hi CraigTP, I do not think this link covers what I am confused about. Please correct me if I missed anything. – George2 Jul 18 '10 at 14:17
  • The correct answer is by D Hoerster below. Fiddler has never cared about what port the server is using. – EricLaw Jul 19 '10 at 22:03

3 Answers3

2

Have you tried adding a dot after the localhost? Quick test on my machine seems to indicate this is needed in IE but might not be in Firefox actually.

Martin Smith
  • 438,706
  • 87
  • 741
  • 845
  • Hi Martin, I tried that dot works if I access a Url directly. But after accessing the page with dot url, if I click a link (for example, in code the url is written as "test.aspx"), there will be errors since ASP.Net test serve do not know how to access localhost.:1870/test.aspx (only knows how to access localhost:1870/test.aspx). Any ideas how to resolve page link issue in "dot" solution? – George2 Jul 18 '10 at 14:15
  • In your "OnBeforeRequest" solution, for this statement -- "if(oSession.host == ":")", shall I change to "if(oSession.host == "localhost:1870")? The same question for statement "oSession.host=localhost:", shall I change it to "oSession.host=localhost:1870"? – George2 Jul 18 '10 at 14:36
  • @George - No I didn't need to do that. For me the development web server worked fine with the links. Are you using absolute URLs in your application? – Martin Smith Jul 18 '10 at 15:32
2

If you change your URL to 'http://ipv4.fiddler:1870/..' instead of 'http://localhost:1870/...' then fiddler will intercept your traffic and display the requests. Localhost doesn't go through wininet (I believe) which fiddler will then ignore. Fiddler registers ipv4.fiddler as localhost so you can monitor local traffic.

You can also add an entry to your hosts file and direct some URL (e.g. mysite.com 127.0.0.1) and use it as your URL (e.g. http://mysite.com:1870/...) and fiddler will pick that up, too.

David Hoerster
  • 28,421
  • 8
  • 67
  • 102
1

Doesn't fiddler ignore 'Localhost' try changing the url's to your machines hostname.

Dog Ears
  • 9,637
  • 5
  • 37
  • 54