Java technique for bypassing proxy doesn't work on Mac

Discussion in 'Mac Programming' started by vikasu, Aug 28, 2008.

  1. vikasu macrumors newbie

    Nov 6, 2007
    Dear All,

    I wrote the following (Java) code:

    List list = ProxySelector.getDefault().select(new URI(""));
    Object obj[] = list.toArray();
    for(Object alist:list)
    Proxy proxy = (Proxy)alist;
    if(proxy != null && proxy.type() != Proxy.Type.DIRECT)
    m_bProxyRequired = true;


    It works well when I give Bypass Proxy information ([System Preferences->Network -> Advanced... -> Proxies - Bypass Proxy Settings for Hosts & Domains]) as directly.
    But it fails when I give 192.168.60.* or
    192.168.60/24. I mean whether there is some problem in Java ProxySelector API for Mac OS or there is some other technique for doing the same.

    What I need to do is my "MyServer" can be in any range, let it can be deployed between IP to, so for that I want to bypass IPs for this range. Now if I write even 192.168.60.* in Bypass Proxy field then also it doesn't work and works well (i.e. doesn't ask for Proxy information) for .

    So do anybody have any such idea for this problem, or any other technique ?


Share This Page