get.releaseConnection();
}
public void testAuthGet() throws Exception {
Credentials creds = new UsernamePasswordCredentials("user", "password");
SimpleProxy proxy = new SimpleProxy();
proxy.requireCredentials(creds);
HttpClient client = new HttpClient();
HostConfiguration hc = new HostConfiguration();
hc.setHost("localhost", 8080, Protocol.getProtocol("http"));
hc.setProxy(proxy.getLocalAddress(), proxy.getLocalPort());
client.setHostConfiguration(hc);
client.getState().setProxyCredentials(null, null, creds);
GetMethod get = new GetMethod("/");
client.executeMethod(get);