hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Dingfelder <Stefan.Dingfel...@gli-micram.de>
Subject Re: Connecting through Proxy
Date Wed, 25 Feb 2004 15:43:18 GMT
Hi Saifadam,

that may depend upon the proxy also. If it is a Microsoft proxy you need 
to use NTLM authentification which requires NTCredentials.
http://jakarta.apache.org/commons/httpclient/authentication.html 
contains some further infos. At least that was what I needed.

Just my two cents,
 Stefan Dingfelder

Saifadam Pathan schrieb:

> I tried numerous suggestions from the list on how to authenticate via 
> proxy when you try the httpclient. But noe worked. Then i ended up 
> using these steps...
>  
> /********************************************************************************************************************

> */
>  
> HttpClient client = new HttpClient();
>  
>        
>     client.getState().setAuthenticationPreemptive(true);
>     client.getHostConfiguration().setProxy("proxyHost", nProxyPortNo); 
>                         // proxyHost is location of proxy server    
> (ipaddress)
>
>     client.getState().setProxyCredentials(null, null, new
>                     UsernamePasswordCredentials("proxyusername", 
> "proxypassword"));
>  
>  
>     // Create a method instance.
>     HttpMethod method = new GetMethod(url);
> /********************************************************************************************************************

> */
>  
>  
> Hope this will help someone else save their time.
>  
> Regards...
>  
> Saifadam Pathan
> Project Engineer
> ControlNet India Pvt Ltd.
> Goa- India
>
>------------------------------------------------------------------------
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org
>



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org


Mime
View raw message