Using content replacement values in the Replace Proxy Web Forward
Proxy Content Replacement
The replacement proxy service works by transforming the paths of image sources and hyperlinks on intranet pages in such a way that requests to these resources are redirected to the SSL-Explorer server which fetches the web page on the users behalf, again performing this transformation on the fetched page. It does this by replacing their original URLs with ones that point to the SSL-Explorer server.
This process works fine for more basic web pages, though certain intranet resources that use extensive ASP or JavaScript may prove problematic. This is because not all URLs can be successfully matched and replaced by the current version of SSL-Explorer.
To address this problem we allow for custom content replacement values to be specified. The SSL-Explorer will locate instances of the values and replace them with a replacement value that you specify. The ultimate aim of which is to capture all rogue URLs that are not already being transformed, and replace them with custom URLs that are described in this section.
Regular Expressions and Capturing Groups
The main feature that SSL-Explorer uses for string replacement is known as 'capturing groups'. You effectively write what is known as a regular expression to break a matched string up into parts. For instance, say you want to replace the URL in an image tag such as:
<img src="http://www.google.com/image.gif"/>
You need to extract the URL part and replace only that, so you write a regular expression to break it up into its constituent parts:
(img src=")([^"])(")
That breaks the URL into three capturing groups. The first one will contain:
img src="
The second will contain:
http://www.google.com
And the third:
"/>
The corresponding replacement pattern is:
$1%2$3
This is defined as:
$1 Replace capturing group one verbatim.
%2 Replace capturing group two with the proxied path.
$3 Replace capturing group three verbatim.
Content replacement is an advanced feature designed for technically aware users. Were working on ways to provide greater support to allow for greater webification of your intranet applications. We have used the Pattern class from the 1.4.2 JDK to perform this function, and there is documentation available from Sun Microsystems [1] that you will need to refer to for a full list of the parameters available for regular expressions.