Skip to content

Instantly share code, notes, and snippets.

@vpack
Last active August 29, 2015 14:23
Show Gist options
  • Save vpack/d48b1d771b4a1e384898 to your computer and use it in GitHub Desktop.
Save vpack/d48b1d771b4a1e384898 to your computer and use it in GitHub Desktop.
Mac Local Cache

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"

Restart Polipo:

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:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment