If you want to use Jetspeed with a proxy and don't want to use a proxy for
*all* connections (see problems in my note yesterday), I could offer a patch.
Question: Should I commit this in the alpha 1 (it's more a new feature that
a bug fix), wait for alpha 2 or don't you like it at all?
ingo.
Proxy Patch
===================================================================
Define in JR.p:
services.URLManager.HTTPProxy.host=proxy.boeblingen.de.ibm.com
services.URLManager.HTTPProxy.port=80
Change class org apache.jetspeed.services.urlmanager.URLFetcher:
@@ -159,8 +159,26 @@
addRealtimeURL( url );
}
try {
- URL content = new URL( url );
+ URL content;
+
+ String proxyName =
TurbineResources.getString("services.URLManager.HTTPProxy.host", null);
+ if (proxyName != null)
+ {
+ int proxyPort = Integer.parseInt(
TurbineResources.getString("services.URLManager.HTTPProxy.port", "-1") );
+ content = new URL("http", proxyName, proxyPort, url);
+ }
+ else
+ {
+ content = new URL( url );
+ }
+
URLConnection conn = content.openConnection();
return getReader( conn );
@@ -217,8 +235,25 @@
//only update this if the URL on which it is based is newer
//than the one on disk.
- URL sock = new URL( url );
+ URL sock;
+
+ String proxyName =
TurbineResources.getString("services.URLManager.HTTPProxy.host", null);
+ if (proxyName != null)
+ {
+ int proxyPort = Integer.parseInt(
TurbineResources.getString("services.URLManager.HTTPProxy.port", "-1") );
+ sock = new URL("http", proxyName, proxyPort, url);
+ }
+ else
+ {
+ sock = new URL( url );
+ }
DiskCacheEntry dce = null;
if( DiskCacheUtils.isCached(url) ) {
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/[email protected]/>
List Help?: [EMAIL PROTECTED]