proxy

Install: tinyproxy

sudo apt-get install -y tinyproxy
 
sed -i 's|#Allow 192.168.0.0/16|Allow 192.168.0.0/16|g' /etc/tinyproxy.conf
sed -i 's|Port 8888|Port 8080|g' /etc/tinyproxy.conf
 
Port 80
Allow 10.0.0.0/8
 
FilterExtended On
FilterURLs On
FilterDefaultDeny Yes
Filter "/etc/tinyproxy/whitelist"
#Filter "/etc/tinyproxy/filter"
 
 
service tinyproxy restart

Configure proxy

export http_proxy=http://10.203.0.1:5187/
export https_proxy=$http_proxy
export ftp_proxy=$http_proxy
export rsync_proxy=$http_proxy
export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"

cat <> /etc/environment
export http_proxy="http://${PROXY_USER}:${PROXY_PASS}@192.168.0.222:8080"
export https_proxy="http://${PROXY_USER}:${PROXY_PASS}@192.168.0.222:8080"
export no_proxy="localhost,127.0.0.1,foo.example.com"
EOF

cat < /etc/apt/apt.conf.d/12proxy
Acquire::http::Proxy "http://${PROXY_USER}:${PROXY_PASS}@192.168.0.222:8080";