Forum Discussion
Ben_Kennedy_502
Nimbostratus
Nov 17, 2006Stream not working
Hello,
I've tried using stream for the first time to alter a string returned (in XML) from http to https. I have the profile assigned to the virtual which seems to have done absolutely nothing.
profile stream soapfault_profile {
defaults from stream
source "http://www.url.co.uk:81/"
target "https://www.url.co.uk/"
}
I therefore implemented a rule as I was told it might have to be activated:
rule soapfault_rule {
when HTTP_REQUEST {
if { [HTTP::method] eq "POST" } {
STREAM::enable
log local0.warn "stream enabled " }
else {
STREAM::disable
log local0.warn "stream not enabled"
}
}
}
Both the rule and stream profile are applied to the vip.
As it's XML the request is a POST and when I test I can see the log firing, however the string is still coming back unaltered. Does anyone know what might be causing this please?
Thanks
4 Replies
- hoolio
Cirrostratus
Hi,
Is the string that you want to replace located in the HTTP data (as opposed to the headers)? Can you log the HTTP::payload command output to verify the string is there?
Also, what version of BIG-IP are you running?
Aaron - Ben_Kennedy_502
Nimbostratus
Hi,
It turns out the string wasn't there, I was testing manually not realising my request was used in the repsonse (host) so it seems to be working. I do have a problem now with the Content length being too short following the stream replacement. I shall have a look around the forum though as I imiagine that must pop up quite a lot.
Thanks,
Ben - hoolio
Cirrostratus
Good to hear you figured it out. Deb posted a solution for the content length issue you're encountering (Click here):
Change Response Chunking to "Rechunk" on the http profile for that virtual.
Aaron - Ben_Kennedy_502
Nimbostratus
Hi,
That's fixed it, almost! Is stream a bit flaky? I've been testing myself, and occasionally the stream doesn't seem to have been replaced, even though I'm sending the same request and receiving the same responses.
rule soapfault_rule {
when HTTP_RESPONSE {
set ::soap_stream_in "http://[clientside {[HTTP::host]}]:81"
set ::soap_stream_out "https://[clientside {[HTTP::host]}]"
if {[HTTP::header Content-Type] contains "xml"} {
STREAM::enable
STREAM::expression "@$::soap_stream_in@$::soap_stream_out@"
log local0.warn "@$::soap_stream_in@$::soap_stream_out@"
} else {
STREAM::disable }
}
}
The rule should only be matching things with xml in the content-type response,but the capture below shows the rule should be matched but the url is not being redirected to https. I can't see why it only fails intermittently when the same request is sent time after time and works 90% of the time, any advice would be grateful:
POST /Services/CallIdL1/CallIdL1.asmx HTTP/1.1
User-Agent:Mozilla/4.0(compatible; MSIE 6.0; MS Web Services Client Protocol 1.1 .4322.2032)
Content-Type:text/xml; charset=utf-8
SOAPAction:"urn:callcredit.plc.uk/soap:callidl1api/Search"
Content-Length:1863
Expect:100-continue
Host:host.com
HTTP/1.1 100 Continue
xml request
HTTP/1.1 500 Internal Server Error.
Date: Mon, 20 Nov 2006 15:47:59 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 1.1.4322
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Transfer-Encoding: chunked
1f5
soap:Client.InvalidJobId
Invalid OjJobId.
http://host.com:81/Services/CallIdL1/CallIdL1.asmx
0
read:errno=0
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
