I've been working on figuring out some interesting ways to use my revision A Raspberry Pi, and one of the things I'm doing with it requires it to work correctly behind a corporate proxy server. If you're in a similar situation, and need your Pi to work with a proxy server, it's simple to get set up:
You need to edit the
file (where /.profile
is your home folder, e.g.
/home/jeffgeerling
, adding the following lines to the bottom of the file:
# Proxy server (example: https://username:[email protected]:8080). User/pass optional.
export http_proxy=http://[user]:[pass]@[proxy_server_address]:[port]
# Proxy exclusions (don't use the proxy server for these hostnames and IP addresses).
export no_proxy=localhost,127.0.0.0/8
If you'd also like the proxy to apply when running
sudo
commands and when using your Pi as the root user, you need to add the same configuration to
/root/.profile
(this would be helpful if you need to use
sudo apt-get
to install or update software packages).
After you edit and save the file, you can either enter
source ~/.profile
to get the new proxy settings to stick for your current session, or log out and log back in.
One caveat: proxy support varies widely by browserâMidori is configured to use the proxy you set up by default, but doesn't honor the no_proxy environment variable . I tend to use Chromium instead, so it's not an issue for me.