Proxy Switching

It is suggested to get a proxy-switching add-on for your browser of choice. One option is Proxy SwitchSharp on Chrome for this. It gives two-click proxy switching in the toolbar.

Browser for testing Recommendation

For testing your web proxy with browser, Firefox very likely may be the most friendly (and intuitive to change the proxy settings to point to your VM). Below is the instruction to set your web browser, taking Mac OS system for instance.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/343d1b05-6d40-497a-805f-7b4aed6c40a7/Untitled.png

netcat

In the end, your caching proxy will be expected to work with requests from a browser.  As a separate tip, you may want to use a browser different from your default one and change its proxy settings to point to your caching proxy.  And, for testing your web proxy with a browser, Firefox very likely may be the most friendly (and intuitive to change the proxy settings to point to your VM).

But while you're getting things going, testing through a browser doesn't give much helpful debug info when things go wrong.

For this, netcat will likely be very helpful.

For example, you can run this command in your terminal:

netcat -l 8080 > req.txt

then set the browser's proxy info to that host's port 8080, and make a request.  Now the request is in req.txt. e.g.,

GET [<http://www.man7.org/linux/man-pages/man2/recv.2.html>](<http://www.man7.org/linux/man-pages/man2/recv.2.html>) HTTP/1.1
Host: www.man7.org
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:58.0) Gecko/20100101 Firefox/58.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: keep-alive
Upgrade-Insecure-Requests: 1

Now we want to send this request to the caching proxy, so start up the proxy on your vm and do:

cat req.txt | netcat <proxyIP> <proxyPort> > resp.txt
[replace proxyIP and proxyPort appropriately for your caching proxy]

Then you can look in resp.txt and see what came back -- even if its not valid html, or not complete, the response is there.