Skip to content

Instantly share code, notes, and snippets.

@rolroralra
Last active September 13, 2022 09:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rolroralra/2d7d89fe3a4c9296d769c4b752b2f281 to your computer and use it in GitHub Desktop.
Save rolroralra/2d7d89fe3a4c9296d769c4b752b2f281 to your computer and use it in GitHub Desktop.
Proxy Setting
  • Ubuntu

Details

vi /etc/environment
export http_proxy=username:password@proxy-server-ip:8080
export https_proxy=username:password@proxy-server-ip:8082
export ftp_proxy=username:password@proxy-server-ip:8080
export no_proxy=localhost, 127.0.0.1

  • Gradle

Details

$ vi ~/gradle.properties

systemProp.proxySet=true

systemProp.http.proxyHost=70.10.15.10
systemProp.http.proxyPort=8080
systemProp.http.nonProxyHosts=[localhost|127.0.0.1|sds.redii.net|70.121.224.52]

systemProp.https.proxyHost=70.10.15.10
systemProp.https.proxyPort=8080
systemProp.https.nonProxyHosts=[localhost|127.0.0.1|sds.redii.net|70.121.224.52]

  • Maven

Details

# 0. Java에 인증서를 keystore에 등록 

$ keytool -v -alias mavensrv -import \
        -file /etc/pki/ca-trust/source/anchors/SDS.crt \
        -keystore trust.jks
Enter keystore password:
Owner: ....
Issuer: ....
Serial number: ....
Valid from: Mon Feb 21 22:34:25 CET 2005 until: Thu Feb 19 22:34:25 CET 2015
Certificate fingerprints:
         MD5:  .......
         SHA1: .....
Trust this certificate? [no]:  yes
Certificate was added to keystore
[Storing trust.jks]



# 1. ~/.m2/setting.xml
$ cat ~/.m2/setting.xml
<settings>
  <proxies>
   <proxy>
      <id>sds-http-proxy</id>
      <active>true</active>
      <protocol>http</protocol>
      <host>70.10.15.10</host>
      <port>8080</port>
      <nonProxyHosts>www.google.com|*.example.com</nonProxyHosts>
    </proxy>
   <proxy>
      <id>sds-https-proxy</id>
      <active>true</active>
      <protocol>https</protocol>
      <host>70.10.15.10</host>
      <port>8080</port>
      <nonProxyHosts>www.google.com|*.example.com</nonProxyHosts>
    </proxy>
  </proxies>
</settings>


#2. Java Parmeter 형식으로 설정
MAVEN_OPTS="-Dmaven.wagon.http.ssl.insecure=true \
 -Dmaven.wagon.http.ssl.allowall=true \
 -Dmaven.wagon.http.ssl.ignore.validity.dates=true \
 -Dhttp.proxyHost=70.10.15.10 \
 -Dhttp.proxyPort=8080 \
 -Dhttps.proxyHost=70.10.15.10 \
 -Dhttps.proxyPort=8080"

  • Docker Engine

Details

$ sudo su
$ mkdir -p /etc/systemd/system/docker.service.d
$ vi /etc/systemd/system/docker.service.d/proxy.conf
[Service]
Environment="HTTP_PROXY=http://x.x.x.x:8080/"
Environment="HTTPS_PROXY=http://x.x.x.x:8080/"
Environment="NO_PROXY=127.0.0.1,localhost,sds.redii.net"


$ systemctl daemon-reload
$ systemctl restart docker

$ systemctl show --property Environment docker

  • Git

Details

#proxy 설정 확인 
$ git config --global http.proxy http://70.10.15.10:8080
$ git config --global https.proxy http://70.10.15.10:8080
$ git config --global http.sslVerify false

#proxy 설정 해제
$ git config --global --unset http.proxy
$ git config --global --unset https.proxy

# Window 10
$ cat ~/.gitconfig
[user]
  name=rolroralra
  email=shyoung.kim@samsung.com

[http "https://code.sdsdev.co.kr"]
	proxy =
[https "https://code.sdsdev.co.kr"]
	proxy =
[http "https://github.com"]
  sslVerify = false
	proxy = http://70.10.15.10:8080
[https "https://github.com"]
	proxy = http://70.10.15.10:8080

# [http]
#     sslVerify = false
#     proxy = http://70.10.15.10:8080
# [https]
#     proxy = http://70.10.15.10:8080

  • npm

Details

npm config list

npm config set --global proxy http://70.10.15.10:8080
npm config set --global https-proxy http://70.10.15.10:8080
npm config set strict-ssl false
npm config set --global http.sslVerify false

npm config rm --global proxy
npm config rm --global https-proxy

  • Yarn

Details

yarn config list

yarn config set --global proxy http://70.10.15.10:8080
yarn config set --global https-proxy http://70.10.15.10:8080

yarn config delete proxy
yarn config delete https-proxy

  • Template

Details

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