Skip to content

Instantly share code, notes, and snippets.

@SmiddyPence
Created February 6, 2015 09:52
Show Gist options
  • Select an option

  • Save SmiddyPence/568f8905a7e54c2abe42 to your computer and use it in GitHub Desktop.

Select an option

Save SmiddyPence/568f8905a7e54c2abe42 to your computer and use it in GitHub Desktop.

Revisions

  1. SmiddyPence created this gist Feb 6, 2015.
    17 changes: 17 additions & 0 deletions HttpProxyConfig.java
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    static {
    final String authUser = "XXXXX";
    final String authPassword = "XXXXXX";
    Authenticator.setDefault(
    new Authenticator() {
    public PasswordAuthentication getPasswordAuthentication() {
    return new PasswordAuthentication(
    authUser, authPassword.toCharArray());
    }
    }
    );

    System.setProperty("http.proxyHost", "XXXXX");
    System.setProperty("http.proxyPort", "80");
    System.setProperty("http.proxyUser", authUser);
    System.setProperty("http.proxyPassword", authPassword);
    }