Rule based invocation of ICAP services using IRML
March 2002



A Rule based framework for invoking ICAP services is  proposed in [4] The rules are to be specified as XML data  (using the IRML specification).

The following is the DTD for IRML:
 <!ELEMENT rulemodule    (owner, protocol, rule+)>
 <!ELEMENT owner         (name, id)>
   <!ELEMENT name          (#PCDATA)>
   <!ELEMENT id            (#PCDATA)>
 <!ELEMENT protocol      (#PCDATA)>
 <!ELEMENT rule          (property | action)+>
   <!ELEMENT property      (property | action)+>
   <!ELEMENT action        (#PCDATA)>
 <!ATTLIST owner         class  (content provider |
                                         access provider | client) #REQUIRED>
 <!ATTLIST rule          processing-point   (1|2|3|4)      #REQUIRED>
 <!ATTLIST property      name               CDATA          #REQUIRED>
 <!ATTLIST property      matches            CDATA          #REQUIRED>
 <!ATTLIST property      case-sensitive     (yes|no)   #DEFAULT "no">

An example IRML file is shown below:

 <?xml version="1.0"?>
  # Rule for sending the right GIF (For pocket PC)
  # Note the nested condition checks
  <owner class="ISP">
   <name>Geetha Manjunath</name>
   <rule processing-point="4">
    <property name="User-Agent" matches="*CE*">
      <property name="Request-Path" matches=".*hotspot_long.gif">

  # Rule for translating to French based on Client Id
  <owner class="client">
    <name> Venky </name>
   <rule processing-point="4">
      <property name="Client-Id" matches=".*">

Steps for modifying the rules of invocation:

    1.Author a new proxylet (optional).
           Define a subclass of HTTPProxylet, and override its methods.
           Use the API in modules  HttpProxyletRequest and HttpProxyletResponse
    2.Modify icap_server/irml/rules.xml appropriately
    3.Translate the IRML file to Python code
           a) Set up PYTHONPATH
                  cd icap_server
                  . setup
           b) cd icap_server/irml
           c) make install
    4.Restart ICAP server


[1] The ICAP forum at
[2] The OPES forum at
[3] "Proxylet Local Execution Environment Local Binding", IETF  Draft.
[4] IRML: A Rule Specification Language for Intermediary Services, IETF Draft,
[5] Squid Web Proxy ,
[6] Medusa Server,
[7] A Python based ICAP Server
[8] Project page,

Contact Info

For any comments or feedback on this code or project, please feel free to write to:
Geetha Manjunath
Technical Consultant,
Hewlett Packard India Software Operations Ltd.

This project is  sponsored by Hewlett Packard Labs.