Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 90876 invoked from network); 30 Mar 2006 05:59:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 30 Mar 2006 05:59:55 -0000 Received: (qmail 37890 invoked by uid 500); 30 Mar 2006 05:59:54 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 37146 invoked by uid 500); 30 Mar 2006 05:59:52 -0000 Mailing-List: contact harmony-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-dev@incubator.apache.org Received: (qmail 37135 invoked by uid 99); 30 Mar 2006 05:59:52 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Mar 2006 21:59:52 -0800 X-ASF-Spam-Status: No, hits=1.4 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: 202.81.18.152 is neither permitted nor denied by domain of paulex.yang@gmail.com) Received: from [202.81.18.152] (HELO ausmtp04.au.ibm.com) (202.81.18.152) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Mar 2006 21:59:51 -0800 Received: from sd0208e0.au.ibm.com (d23rh904.au.ibm.com [202.81.18.202]) by ausmtp04.au.ibm.com (8.13.6/8.13.5) with ESMTP id k2U686Yo260012 for ; Thu, 30 Mar 2006 17:08:06 +1100 Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.250.237]) by sd0208e0.au.ibm.com (8.12.10/NCO/VER6.8) with ESMTP id k2U62ehd236110 for ; Thu, 30 Mar 2006 17:02:45 +1100 Received: from d23av04.au.ibm.com (loopback [127.0.0.1]) by d23av04.au.ibm.com (8.12.11/8.13.3) with ESMTP id k2U5xLN3024305 for ; Thu, 30 Mar 2006 15:59:21 +1000 Received: from d23m0011.cn.ibm.com (d23m0011.cn.ibm.com [9.181.32.74]) by d23av04.au.ibm.com (8.12.11/8.12.11) with ESMTP id k2U5xKpI024278 for ; Thu, 30 Mar 2006 15:59:21 +1000 Received: from [127.0.0.1] ([9.181.106.208]) by d23m0011.cn.ibm.com (Lotus Domino Release 6.53HF294) with ESMTP id 2006033013591823-3197 ; Thu, 30 Mar 2006 13:59:18 +0800 Message-ID: <442B73B2.1020105@gmail.com> Date: Thu, 30 Mar 2006 13:59:14 +0800 From: Paulex Yang User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 To: harmony-dev@incubator.apache.org Subject: bug-to-bug compatiblity case: Proxy handling X-MIMETrack: Itemize by SMTP Server on D23M0011/23/M/IBM(Release 6.53HF294 | January 28, 2005) at 30/03/2006 13:59:18, Serialize by Router on D23M0011/23/M/IBM(Release 6.53HF294 | January 28, 2005) at 30/03/2006 13:59:20, Serialize complete at 30/03/2006 13:59:20 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=GB18030; format=flowed X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi, About the Internet proxy properties, the Java 5 document says '*' can be used as wild card character for matching, as below "http.nonProxyHosts indicates the hosts which should be connected too directly and not through the proxy server. The value can be a list of hosts, each seperated by a |, and in addition a wild card character (*) can be used for matching. For example: -Dhttp.nonProxyHosts="*.foo.com|localhost". " But RI's behavior looks strange. The wildcard character works only if it's the first or last character in "host" String. Test case below shows the details. Shall we make Harmony be compatible with RI? public void testNonProxyHosts() throws URISyntaxException { ProxySelector selector = ProxySelector.getDefault(); List proxyList; Proxy proxy; // set http proxy System.setProperty("http.proxyHost", "192.168.0.1"); // RI works as expected if '*' is the last character System.setProperty("http.nonProxyHosts", "10.10.*"); proxyList = selector.select(new URI("http://10.10.1.2")); proxy = (Proxy) proxyList.get(0); assertEquals(Proxy.NO_PROXY, proxy); // If '*' is neither the first character nor the last character, '*' // RI consider '*' as a common character instead of wild card System.setProperty("http.nonProxyHosts", "10.10.*.2"); proxyList = selector.select(new URI("http://10.10.*.2")); proxy = (Proxy) proxyList.get(0); assertEquals(Proxy.NO_PROXY, proxy); // the test below confirms that the '*' is not considered as wild card System.setProperty("http.nonProxyHosts", "10.10.*.2"); proxyList = selector.select(new URI("http://10.10.1.2")); proxy = (Proxy) proxyList.get(0); assertEquals(Proxy.Type.HTTP, proxy.type()); assertEquals("192.168.0.1:80", proxy.address().toString()); } -- Paulex Yang China Software Development Lab IBM