Monday, January 5, 2015

Proxy Configurations for different apps


*************   MAVEN
.setting file in <USER>\.m2 folder


<settings>
  <proxies>
   <proxy>
      <active>true</active>
      <protocol>http</protocol>
      <host>proxyHost</host>
      <port>proxyPort</port>
      <username>USERNAME</username>
      <password>PASSWORD</password>
      <nonProxyHosts>127.*</nonProxyHosts>
    </proxy>
  </proxies>
</settings>



*************** NODE JS

npm config set https-proxy http://USERNAME:PASSWORD@proxyHost:proxyPort
npm config set proxy http://USERNAME:PASSWORD@proxyHost:proxyPort


*************** JAVA

*************** JAVA

System.setProperty("http.proxyHost", "proxyHost");
System.setProperty("http.proxyPort", "proxyPort");
Authenticator authenticator = new Authenticator() {
     public PasswordAuthentication getPasswordAuthentication() {
    return (new PasswordAuthentication("USERNAME","PASSWORD".toCharArray()));
    }
};
Authenticator.setDefault(authenticator);

No comments:

Post a Comment