Skip to content
This repository has been archived by the owner on Aug 5, 2022. It is now read-only.
Geoff Gustafson edited this page Oct 6, 2016 · 5 revisions

If you're unfortunate enough to work behind a proxy, here are my tips for getting things working well enough to work with ZJS.

These instructions are based on Ubuntu 16.04.

Set up system proxy

Hit the Windows key, type 'proxy', and select the 'Network' settings item that comes up. Click on the "Network proxy" item on the left. Then enter your proxy settings with either the Automatic or Manual method depending on your environment.

Set up command line proxy

Add these lines to your ~./bashrc:

export http_proxy="http://<proxy.example.com>:<port>/"
export https_proxy="https:<proxy.example.com>:<port>/"
export ftp_proxy="http://<proxy.example.com>:<port>/"
export socks_proxy="http://<proxy.example.com>:<port>/"
export no_proxy="localhost,<example.com>,<.example.com>"

Then source your bashrc again:

$ source ~/.bashrc

Set up sudo to retain these environment variables

Add this line to your /etc/sudoers file (you can use $ sudo visudo to edit the file without permissions difficulties):

Defaults    env_keep = "http_proxy https_proxy ftp_proxy socks_proxy no_proxy"

This will mean that when you do sudo commands, those variables will still be set from your normal user environment, so sudo will inherit your proxy settings and things like sudo apt-get update will work.

Set up ssh config

Create or update the file ~/.ssh/config with a section like this:

Host *.github.com github.com
        Protocol 2
        ProxyCommand nc -x<proxy.example.com> -X5 %h %p

(This assumes you have a SOCKS5 proxy on default port 1080.)

Now, you should be ready to go, unless your situation is even worse than mine.