Proxying Apache Bench through Fiddler

The directions as follows work for a local VM environment (VirtualBox/Vagrant), on a Windows host. Apache Bench is installed from XAMPP. If pointing ab directly at the VM, use the machine IP address (127.0.0.1 is fine). If proxying through Fiddler, it must use localhost, or the requests do not display in Fiddler. You must also select “Allow Remote Computers to Connect” in the Tools->Fiddler Options menu, under “Connections.”

POST request without Fiddler:

ab -n 1 -p post.txt -T application/x-www-form-urlencoded http://127.0.0.1:8080/index.js

POST request with Fiddler (you can also use the machine IP or hostname here):

ab -n 1 -X localhost:8888 -p post.txt -T application/x-www-form-urlencoded http://localhost:8080/index.js

Also note that complicated URLs may need to be quoted on the command line:

ab -n 100000 "http://127.0.0.1:8080/index.js?mode=data&fn=set_data&l=1&a0=%5B%22lozanotek%20/%20Viewfinder%22%2C%22search_langOverride%3D%26language%3D%26q%3Dfork_false%26repo%3D%26start_value%3D10659%26type%3DRepositories%22%2C%22Simple%20filter%20and%20classes%20that%20allow%20you%20to%20find%20views%20depending%20on%20the%20context%20for%20the%20request%22%2C%22%28JavaScript%29%22%5D"