Forum Discussion
hooleylist
Jul 08, 2008Cirrostratus
It would be good to disable the stream filter by default and then enable it for specific responses. This ensures that the stream filter isn't applied on subsequent HTTP responses on the same TCP connection.
I'm not sure if you're trying to check the client IP address or the server IP address. IP::remote_addr in a serverside event context (like HTTP_RESPONSE) will return the server IP. If you want to check the client IP, you can use IP::client_addr (in any context).
when HTTP_RESPONSE {
Remove the Pragma header
HTTP::header remove "Pragma"
Disable the stream filter by default
if { [HTTP::header Content-Type] contains {text/html;charset=UTF-8} and not ([IP::addr [IP::remote_addr] equals 208.57.158.0/255.255.255.0]) } {
Set a stream expression
STREAM::expression "@http://system.college.ac.uk@https://system.college.ac.uk@"
Enable the stream profile for this response
STREAM::enable
}
}
Aaron