Use Fiddler on localhost only
Is there a way to set Fiddler software to log only "localhost" and not all the web traffic ?
Thanks,
Solution 1:
Yes you can. Fiddler has a filters option in which you can specify the name of your computer. Here's the steps:
- Make sure you have the latest version of fiddler
- Click on the "Filters" tab (in the same line of Inspectors).
- Click on "Use Filters"
- In the text area enter the name of your computer.
- Left click on the request area (so it will be saved).
If everything went well, fiddler has a green arrow on the Filters tab. Just browse to the website using your machine name so instead of:
http://localhost/MySite
Go to
http://my-machine-name/MySite
Solution 2:
I found these ways to only log localhost traffic, either should work.
- 'Show only Intranet Hosts', which excludes hostnames with a dot in them
- 'Show only the following Hosts' just specify only to log localhost as below
Solution 3:
Here you can find how.
When I test local websites I usually add an entry in the hosts file %systemroot%\System32\drivers\etc\hosts
127.0.0.1 somewebsite
And then I set the bindings on IIS 7 to point to somewebsite
So I can test using "http://somewebsite". Fiddler tracks this.
update
To show only the localhost traffic:
Go to Rules\Customize Rules...
On Handlers class add this menu option
...
class Handlers
{
public static RulesOption("Show Localhost Only")
var m_ShowLocalHostOnly: boolean = false;
....
On the function OnBeforeRequest
... static function OnBeforeRequest(oSession: Session) {
// Hide requests based on target hostname.
if (m_ShowLocalHostOnly &&
!(oSession.host =="127.0.0.1"
|| oSession.host =="localhost"
|| oSession.host =="somewebsite"))
{
oSession["ui-hide"]="true";
}
...
Save this file (Ctrl + S), then choose the new option from the Rules menu.