Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxy (Ubuntu) #14

Open
kwojcicki opened this issue Jun 19, 2019 · 6 comments
Open

Proxy (Ubuntu) #14

kwojcicki opened this issue Jun 19, 2019 · 6 comments

Comments

@kwojcicki
Copy link
Owner

kwojcicki commented Jun 19, 2019

curl/apt

vi /etc/environment
http_proxy=http://<host:port>
https_proxy=http://<host:port>
ftp_proxy=http://<host:port>
no_proxy="localhost,127.0.0.0"
@kwojcicki
Copy link
Owner Author

kwojcicki commented Jun 19, 2019

any application that respects $HTTP_PROXY/$http_proxy etc...

vi ~/.bashrc
http_proxy=http://<host:port>
https_proxy=http://<host:port>
ftp_proxy=http://<host:port>
no_proxy="localhost,127.0.0.0,24,192.168.39.0/24"
HTTP_PROXY=$http_proxy
HTTPS_PROXY=$https_proxy
NO_PROXY=$no_proxy

@kwojcicki
Copy link
Owner Author

vscode

code --proxy-server="http=$http_proxy;https=$https_proxy"

@kwojcicki
Copy link
Owner Author

kwojcicki commented Jun 19, 2019

docker (containers)

vi ~/.docker/config.json
 "proxies":
 {
   "default":
   {
     "httpProxy": "http://<host:port>",
     "httpsProxy": "http://<host:port>",
     "noProxy": "localhost,127.0.0.0,...."
   }
 }
}

@kwojcicki
Copy link
Owner Author

maven

vi $~/.m2/settings.xml
<settings>
  .
  .
  <proxies>
   <proxy>
      <id>example-proxy</id>
      <active>true</active>
      <protocol>http</protocol>
      <host>proxy.example.com</host>
      <port>8080</port>
      <username>proxyuser</username>
      <password>somepassword</password>
      <nonProxyHosts>www.google.com|*.example.com</nonProxyHosts>
    </proxy>
  </proxies>
  .
  .
</settings>

@kwojcicki
Copy link
Owner Author

Docker daemon

sudo mkdir -p /etc/systemd/system/docker.service.d

If you are behind an http proxy

sudo vi /etc/systemd/system/docker.service.d/http-proxy.conf
[Service]
Environment="HTTP_PROXY=http://proxy.example.com:80/"

Or if you are behind an https proxy

sudo vi /etc/systemd/system/docker.service.d/https-proxy.conf
[Service]
Environment="HTTPS_PROXY=https://proxy.example.com:443/"	

Then reload the changes

sudo systemctl daemon-reload
sudo systemctl restart docker

And ensure your proxy appears in the following output

systemctl show --property=Environment docker

@kwojcicki
Copy link
Owner Author

vagrant proxy

vagrant plugin install vagrant-proxyconf
export VAGRANT_HTTP_PROXY=${http_proxy}
export VAGRANT_NO_PROXY="127.0.0.1"
vagrant up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant