iRule Events where STREAM::enable is Allowed

Does anyone have a definitive list of iRule events where STREAM::enable can be used? I’ve been trying to use it in a clientside context in the HTTP_REQUEST_SEND rule, but it doesn’t seem to have any effect.

What I’m trying to do here is to take action based on the result of an ICAP server (integrated with a request adaptation profile), but ignore the actual content ICAP returned. I’d like to modify the original request instead with a Stream profile.

From what I can gather, ADAPT_REQUEST_RESULT fires after HTTP_REQUEST (the iRules order page doesn’t have the ADAPT events), so I’m left with a limited number of events where I can modify the request. I’ve tried both HTTP_REQUEST_SEND and HTTP_REQUEST_RELEASE, but neither seems to actually execute the STREAM::enable command.

Here’s an excerpt of my iRule:

when HTTP_REQUEST {
  STREAM::disable

   ... snip ... some standard, non-stream related commands
}

when ADAPT_REQUEST_RESULT {
  if { [ADAPT::result] equals "bypass" } {
    set need_stream 0
  } else {
    set need_stream 1
     reset result to bypass to ignore response from ICAP server
    ADAPT::result bypass
  }
}

when HTTP_REQUEST_SEND {
  if { $need_stream == 1 } {
    clientside {
      HTTP::uri "/rewritten/uri"
      STREAM::expression {@FIND@REPLACE@}
      STREAM::enable
    } 
  }
}

Thank you in advance for any suggestions.

Hi Mate, just checking if you have stream profile assigned to same VS to whom this irule is applied?

Apologies for the slow reply. I did have a stream profile assigned. I’ve ended up having to take a different approach for now due to changed requirements, so I’ve gone with a totally different approach.

I never ended up finding a definitive answer, though my SE mentioned the documentation for STREAM::max_matchsize says it is only valid in HTTP_REQUEST and HTTP_RESPONSE, so it’s likely the rest of the stream commands are only allowed in those events, too.