How to add Http Header for testing using Fiddler on Windows

For example you want to test a website logs “Forwarded” request header.

Run Fiddler.  (tested version 4.6.2.x)

Select Rules -> Custom Rules.

This opens CustomRules.js in notepad.

Search for “static function OnBeforeRequest(oSession: Session)”

after the next curly brace “{” enter the following :

oSession.oRequest["Forwarded"] = "for=192.0.2.60; proto=http; by=203.0.113.43";

then save the file.

With Fiddler still running, open a browser & navigate to your test site.  The header will be applied to each request.