Forum Discussion
Kai_Wilke
Aug 30, 2016MVP
Hi Jim,
it doesn't matter where the tag is placed, since STREAM doesn't understand HTML at all. It just sees the flying by bits and bytes an then applies a replacements if a given search pattern is found.
Just combinaed my provided iRule logic with your provided HTML using the iRule below...
when HTTP_REQUEST {
Disable STREAM for HTTP_REQUESTs
STREAM::disable
Remove the "Accept-Encoding" header to see cleartext data on the responses.
Note: You could also use a HTTP-Compression Profile to remove the
Accept-Encoding header on the server side
(Profile Option: Keep Accept Encoding = Disabled).
By doing this, you can STREAM the content without losing
the ability to support a client side compression.
HTTP::header remove "Accept-Encoding"
if { [HTTP::path] eq "/stream" } then {
set content {
hi from jim
}
HTTP::respond 200 content $content "Content-Type" "text/html"
} else {
HTTP::path "/stream"
virtual [virtual]
}
}
when HTTP_RESPONSE {
Rechunk any Chunked Responses to become able to STREAM those content, without braking the Application.
if {[HTTP::header exists "Transfer-Encoding"]} {
HTTP::payload rechunk
}
Apply STREAM expression just to Content-Type = text
if {[HTTP::header value "Content-Type"] contains "text"}{
Set the STREAM expression
STREAM::expression {@https://1.1.1.1@https://www.site.de@}
Enable STREAM of the current response
STREAM::enable
}
}
Output:
hi from jim
Cheers, Kai