This piece of code is working for me:

HttpParams params = new BasicHttpParams();
params.setParameter(ConnRoutePNames.DEFAULT_PROXY, new
HttpHost(proxyhostname, 80));
client = new DefaultHttpClient(cm, params);

You might want to look at something similar.

JM

2013/1/24, Kevin Weslowski <weslo...@accesscomm.ca>:
> Hi,
>
> I have some URLConnection code that connects through a proxy:
> ============================
> java.net.URL url = new java.net.URL("http://www.google.com";);
> java.net.SocketAddress sa = new java.net.InetSocketAddress("myproxyserver",
> 8080);
> java.net.Proxy proxy = new java.net.Proxy(java.net.Proxy.Type.HTTP, sa);
> java.net.HttpURLConnection con = (java.net.HttpURLConnection)
> url.openConnection(proxy);
> ============================
> and I want to convert that to equivalent httpclient code but I can't seem to
> find the right way to do that. Can someone point me in the right direction?
> Thanks...
>
> Kevin
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
> For additional commands, e-mail: httpclient-users-h...@hc.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
For additional commands, e-mail: httpclient-users-h...@hc.apache.org

Reply via email to