Sun Java System Web Proxy Server 4.0.3 2006Q2 Configuration File Reference

Filter

The Filter directive runs an external command and then pipes the data through the external command before processing that data in the proxy. This is accomplished using the pre-filter function. The format of the Filter directive is as follows:

Syntax

Filter fn="pre-filter" path="/your/filter/prog"

The Filter directive performs these tasks:

  1. It runs the program /your/filter/prog as a separate process.

  2. It establishes pipes between the proxy and the external program.

  3. It writes the response data from the remote server to the stdin of the external program.

  4. It reads the stdout of the program as if it were the response generated by the server.

    This is equivalent to this command:

    Filter fn="pre-filter" path="/your/filter/prog" headers="stdin"

    The following Filter functions are described in detail in this section:

filter-ct

Applicable in Filter-class directives.

filter-ct can be used to block response content that matches a certain MIME type.

Parameters

The following table describes parameters for the filter-ct function.

Table 5–125 filter-ct parameters

Parameter  

Description  

regexp 

Regular expression of the mime type to be filtered. 

Example


Filter fn="filter-ct" regexp="(application/octet-stream)"

filter-html

Applicable in Filter-class directives.

filter-html can be used to filter out HTML tags from the response content before sending it to the client.

Parameters

The following table describes parameters for the filter-html function.

Table 5–126 filter-html parameters

Parameter  

Description  

start 

HTML start tag 

end 

HTML end tag 

Example


Filter fn="filter-html" start="APPLET" end="APPLET"

pre-filter

Applicable in Filter-class directives.

pre-filter is used to run external filter programs before returning response content to the client.

Parameters

The following table describes parameters for the pre-filter function.

Table 5–127 pre-filter parameters

Parameter  

Description  

path 

absolute path to external filter program. 

Example


Filter fn="pre-filter" path="/your/filter/prog"