try {
int port = Integer.parseInt(proxyPort);
HttpClient client = new HttpClient(proxyHost, port, isSecure);
HttpMethod method = new ConnectMethod(url.getHost(), url.getPort() == -1 ? 443 : url.getPort(), true);
PasswordCredentials credentials = new PasswordCredentials();
credentials.setUsername(proxyUsername);
credentials.setPassword(proxyPassword);