hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: Summer of Code
Date Thu, 02 Jun 2005 12:24:48 GMT
On Thu, Jun 02, 2005 at 02:05:22PM +0200, Ortwin Gl?ck wrote:
> 
> >
> >(1) HttpUrlConnection compatibility wrapper on top of http-common
> >(2) RFC2965 (aka Cookie2)
> 
> I find the two projects really interesting. They are both pretty small.
> 

Actually RFC2965 is not gonna be a walk in the park, but at least this
project would be pretty much self-contained


> I would add a project that rather goes into contrib but my mind has been 
> circling around this one since I started with HttpClient:
> Proxy Auto Configuration (PAC).
> This can be done by using a JavaScript Engine like Rhino and evaluating 
> a JS function at runtime. See 
> http://wp.netscape.com/eng/mozilla/2.0/relnotes/demo/proxy-live.html
> To make it complete, the no-proxy patch of Adrian Sutton could be 
> integrated (see attachment, message still in my local mailbox, but not 
> in the ASF archives).
> 
> I think we should add those three projects.
> 

+1 to that. Go ahead if you want to take that on board

Oleg


> Odi

> From: "Adrian Sutton" <adrian.sutton@ephox.com>
> Subject: [PATCH] Supporting "no proxy hosts"
> To: "'Commons HttpClient Project'" <commons-httpclient-dev@jakarta.apache.org>
> Reply-To: "Commons HttpClient Project" <commons-httpclient-dev@jakarta.apache.org>
> Date: Tue, 8 Oct 2002 08:52:49 +1000
> Message-ID: <0AC2D75550100F4DBDB025D4D0561188448235@BIGCOW.intraephox.ephox.com>
> 
> I needed to have proxy support that matched that of IE and thought I'd
> share.  I'm not sure what the fate of this patch will be with the upcoming
> removal of HttpMultiClient but I needed it now and figured it may be useful
> to others as well.  The general idea would be nice to have in HttpClient
> when it starts providing HttpMultiClient functionality anyway.
> 
> Basically, the patch changes HttpMultiClient so that you can specify a set
> of hosts which should be accessed directly instead of via the proxy.  The
> hosts can be specified exactly or starting with a * to indicate subdomains
> are also included.  ie:
> 
> www.ephox.com to connect directly to just www.ephox.com or *.ephox.com to
> connect directly to www.ephox.com, adrian.ephox.com etc.
> 
> This patch combined with the code below will use whatever proxy settings the
> user specified in the Java Plugin control panel (which is really nice if
> your an applet).  This works on OS X and Windows Java 1.4, other systems
> likely put this stuff in other system properties.
> 
>   private static String proxyHost = null;
> 
>   private static int proxyPort = -1;
> 
>   private static String[] noProxyHosts = new String[0];
> try {
>           String noProxy = "";
>           if
> (System.getProperty("java.vm.vendor").toLowerCase().indexOf("apple") >= 0) {
>               proxyHost = System.getProperty("http.proxyHost");
>               noProxy = System.getProperty("http.nonProxyHosts", "");
>               proxyPort =
> Integer.parseInt(System.getProperty("http.proxyPort", "-1"));
>           } else {
>               String proxy =
> System.getProperty("javaplugin.proxy.config.list", "");
>               noProxy = System.getProperty("javaplugin.proxy.config.bypass",
> "");
>               if (proxy.toLowerCase().indexOf("http=") >= 0) {
>                   proxy =
> proxy.substring(proxy.toLowerCase().indexOf("http=") + "http=".length());
>                   if (proxy.indexOf(",") >= 0) {
>                       proxy = proxy.substring(0, proxy.indexOf(","));
>                   }
>                   proxyHost = proxy;
>                   proxyPort = 8080;
>                   if (proxy.indexOf(":") >= 0) {
>                       proxyHost = proxy.substring(0, proxy.indexOf(":"));
>                       proxyPort =
> Integer.parseInt(proxy.substring(proxy.indexOf(":") + 1));
>                   }
>                   _client.setProxyHost(proxyHost);
>                   _client.setProxyPort(proxyPort);
>               }
>           }
>           StringTokenizer st = new StringTokenizer(noProxy, ",");
>           noProxyHosts = new String[st.countTokens()];
>           for (int i = 0; i < noProxyHosts.length; i++) {
>               noProxyHosts[i] = st.nextToken();
>           }
>           _client.setNoProxyHosts(noProxyHosts);
>       } catch (Exception e) {
>           System.err.println("Failed to detect proxy settings.");
>           e.printStackTrace();
>       }
> 
> Adrian Sutton, Software Engineer
> Ephox Corporation
> www.ephox.com
> 
> This email and any files transmitted with it are confidential and intended
> solely for the use of the individual to whom they are addressed. Opinions
> contained in this email do not necessarily reflect the opinions of Ephox
> Corporation.
> If you have received this email in error please notify the sender
> immediately and delete all copies of the correspondence from your computer
> and/or computer network. No warranty is given that this message upon its
> receipt is virus free and the sender in this respect accepts no liability.


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

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

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


Mime
View raw message