How to setup a local proxy server for testing a program?

Setup pfSense either in virtual machine or set it up on any spare computer (requirements are very low) and follow official documentation how to setup transparent proxy. When you done,

  1. Set up users who allowed to use proxy in Services > Proxy > Users
  2. Disable Transparent HTTP proxy in Services > Proxy > General
  3. Select LOCAL Authentication method in Services > Proxy > Authentication
  4. Disable in firewall outgoing connections to ports 80,443
    (if you really want to create corporate production setup)

To drive workstations over proxy with authentication you either need to setup WPAD (but you would need to setup first any simple web server (can be added as package in pfSense)) or manually on each workstation in
control panel/internet options on the tab Connections hit button LAN settings and tick checkbox Use a proxy server for your LAN in Proxy server section. (Use IP of pfSense and port 3128). This network settings would be applied to the whole system.

If you would go with WPAD then on the same tab
Connections in control panel/internet options leave all check boxes empty except Automatically detect settings. (If you have a lot of computers then it would be better to setup WPAD address in DHCP option 252 on pfSense this way all workstation will pick all settings automatically)

In firefox (in Options->Adavanced->network->Connection Settings) you can choose either
Use system proxy settings (it will pick settings described above) or you may set protocols that should go over proxy with authorization in Manual proxy configuration