ltm rule command STREAM enableΒΆ

iRule(1)		      BIG-IP TMSH Manual		      iRule(1)



STREAM::enable
       Enables the stream filter for the life of the current TCP connection or
       until disabled.

SYNOPSIS
       STREAM::enable

DESCRIPTION
       Enables the stream filter for the life of the current TCP connection or
       until disabled with STREAM::disable.

       Syntax

       STREAM::enable

	    * Enables the stream filter for the life of the current TCP
	      connection or until disabled with STREAM::disable.

	  Configuration requirements:
	  1. To perform the response data replacement an unconfigured stream
	  profile must be configured on the virtual server
	  2. For all versions up 9.4.0, you must force BIG-IP to use chunking and
	  therefore remove the response content length header. This can be done
	  by applying a custom HTTP profile to the virtual server with Response
	  Chunking set to "Rechunk". (See SOL6422 for details.)

       Version Specific Notes

	  * LTM 9.2 - 9.2.4 The Stream filter uses TCL to parse and replace data.
	  TCL has a 4Mb limit for a single allocation or connection. When this
	  limit is exceeded, TMM will crash. See SOL6741 (CR55382 and
	  CR70146) for details and a workaround. This issue was resolved in
	  9.2.5, 9.3 and 9.4+

	  * LTM 9.3.1+, 9.4.2+ STREAM::enable must be called after
	  STREAM::expression. See CR79374

RETURN VALUE
VALID DURING
EXAMPLES
	See the STREAM::expression page for additional examples.
	To check HTTP responses with a Content-Type that contains text, and
	replace http:// with https://:

	when HTTP_REQUEST {

	   # Explicitly disable the stream profile for each request so it doesn't stay
	   #   enabled for subsequent HTTP requests on the same TCP connection.
	   STREAM::disable
	}
	when HTTP_RESPONSE {
	   # Apply stream profile against text responses from the application
	   if { [HTTP::header value Content-Type] contains "text" }{

	      # Look for http:// and replace it with https://
	      STREAM::expression {@http://@https://@}

	      # Enable the stream profile
	      STREAM::enable
	   }
	}
	# This section only logs matches, and should be removed before using the rule in production.
	when STREAM_MATCHED {
	    log local0. "Matched: [STREAM::match]"
	}

	If you only want to replace some http:// links with https://, you can
	specify a more complex regular expression in the 'find' portion of the
	STREAM::expression. For example, to match all http:// links except
	http://schemas.microsoft.com/intellisense/ie5, you can use a negative
	look behind in the regex:

	http:(?!//schemas\.microsoft\.com/intellisense/ie5)

HINTS
SEE ALSO
       STREAM::expression

CHANGE LOG
       @BIGIP-9.2.0 --First introduced the command.



BIG-IP				  2017-01-31			      iRule(1)