Hi,

i am trying to connect my appplication through proxy but not able to connect
it. my sample application as following....

DefaultHttpClient httpclient = new DefaultHttpClient();

HttpHost proxy = new HttpHost("192.168.0.98", 3128, "http");
httpclient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);
httpclient.getCredentialsProvider().setCredentials(
AuthScope.ANY,
new NTCredentials("admin","admin",null,"domain"));

HttpGet httpget = new HttpGet("http://www.google.com";);

System.out.println("executing request" + httpget.getRequestLine());
HttpResponse response = httpclient.execute(httpget);
HttpEntity entity = response.getEntity();

System.out.println("----------------------------------------");
System.out.println(response.getStatusLine());
System.out.println(response.getStatusLine().getStatusCode());


if (entity != null) {
System.out.println("Response content length: " + entity.getContentLength());

}
if (entity != null) {
entity.consumeContent();
}

// When HttpClient instance is no longer needed,
// shut down the connection manager to ensure
// immediate deallocation of all system resources
httpclient.getConnectionManager().shutdown();


can anyone help me

-- 
Thanks
Tej Kiran Sharma
[email protected]

Reply via email to