// プロキシの設定(ホストとポート) System.setProperty("http.proxyHost", "proxy.example.com"); System.setProperty("http.proxyPort", "3128"); // 認証情報の設定 Authenticator.setDefault(new Authenticator() { @Override protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication("myname", "password".toCharArray()); } });