Install polipo and follow instructions from brew
brew install polipo
Using with wget
$ cat ~/.wgetrc
header = Accept-Language: en-us,en;q=0.5
header = Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
header = Connection: keep-alive
user_agent = Mozilla/5.0 (Windows NT 5.1; rv:10.0.2) Gecko/20100101 Firefox/10.0.2
referer = /
robots = off
use_proxy=yes
http_proxy=127.0.0.1:8123
###Vagrant Setup for local proxy:
config.proxy.http = "http://localhost:8123"
config.proxy.https = "http://localhost:8123"
config.proxy.no_proxy = "localhost,127.0.0.1"
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.polipo.plist
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.polipo.plist
#run this periodically to purge cache
polipo -x
Reference: