I am using IIS7 Express while developing my web application. I need to use fiddler to investigate an issue and cannot figure out how to configure things so I can get the HTTP stream. It seems that IIS7 express will only listen on localhost which means I cannot access the stream.
相关问题
- VS2017 RC - The following error occurred when tryi
- Getting Authorization has been denied for this req
- Internal.Cryptography.CryptoThrowHelper.WindowsCry
- IISExpress application pool recycle
- Throttling network speed using Fiddler is not work
相关文章
- The program '[4432] iisexpress.exe' has ex
- Breakpoint in ASP.NET MVC Razor view will not be h
- Can't get azure web role to run locally using
- Bad Request - Invalid Hostname when accessing loca
- Converting cookie string into Python dict
- Fiddler doesn't decompress gzip responses
- How to display the request sent time and the respo
- Fiddlercore is not able Capture the traffic for HT
You can use fiddler as a proxy between your clients and the server. This means you start up fiddler, and then access the server using fiddler's port rather then the usual port (default for fiddler2 is 8888 I think). If you need to debug the server "live" vs. real world clients, you can change the IIS binding from :80 to something else, and place fiddler's proxy on port 80.
EDIT: By the way, by default fiddler2 changes the proxy settings on your browsers so that they access everything through fiddler anyway (on the machine in which fiddler is installed only)
One useful variation of Eric's answer (that was edited by Brett) would be to use
oSession.port
to build theoSession.host
. With this little change, if one needs to capture IIS express traffic onhttp://localhost:12345
, they could usehttp://iisexpress:12345
. That will make it easier to capture traffic for sites with random ports as created by WebMatrix and VS. I tried it out with IE and Firefox and capturing IIS Express traffic was a breeze. Fiddler rocks!.With the latest version of fiddler, you only need to navigate to localhost.fiddler:port. However, doing that alone didn't help me and I was still getting access denied when using Windows Authentication. To fix this, I found this blog entry: http://www.parago.de/2013/01/fiddler-and-the-401-unauthorized-error-with-asp-net-web-api-using-integrated-windows-authentication-wia/
In short, create this key:
Key Path HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\ Control\Lsa\MSV1_0
Value Name BackConnectionHostNames
Value Type REG_MULTI_SZ
String Value localhost.fiddler
This has nothing to do with IIS7 Express and everything to do with the fact that you're using loopback traffic.
Ref: https://www.fiddlerbook.com/fiddler/help/hookup.asp#Q-LocalTraffic
Click Rules > Customize Rules.
Update your Rules file like so:
Then, just visit
http://myapp
in your browser.Or use the address
http://localhost.fiddler/
and Fiddler will use the hostnamelocalhost
instead of converting to an IP address.