Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Can't bypass proxy with HttpURLConnection
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Can't bypass proxy with HttpURLConnection



Hello,

Did anynone succeeded in using HttpURLConnection to connect to an address belonging to an address range supposed to bypass proxy (as defined in " System Preferences > Network > Advanced > Proxies > Bypass proxy settings for these Hosts & Domains") ?

It seems that HttpURLConnection ignores the system proxy "bypass" settings and always try to connect to the proxy, even if the host address is defined in the "bypass" field.

I am facing this problem on Mac OS X 10.5 on both Java 5 and 6.

I tried several solutions but all failed :

1) call System.setProperty("http.proxyHost", "<none>"). Also tried "none" or "".
2) call System.setProperty("http. nonProxyHosts", "my.webserver.com")
3) call System.setProperty("java.net.useSystemProxies", "false")
4) use my own implementation of ProxySelector that returns a list of only one Proxy.NO_PROXY element in the "select" method
5) create instances of HttpURLConnection with Proxy.NO_PROXY parameter, like this :
URL url = new URL("http://my.webserver.com/";);
URLConnection conn = url.openConnection(Proxy.NO_PROXY);
6) played with "Network Settings" in the "Java Preferences" utility and tried "Use proxy server" (instead of "Use system settings") and "Direct connection".



All of these attempts failed. Attempt 1) bypassed the proxy indeed but tried to connect to the address "<none>" or "none", which of course didn't work. All other attempts resulted in tring to connect to the proxy address.


I am probably doing something wrong but I can't see what. Could this be a Java Mac OS X specific issue ? Is there a known workaround ?

Thanks in advance for your help.

Eric Arlotti
email@hidden

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.