HTTP request cloning
Published Mar 18, 2015
Version 1.0Was this article helpful?
12.1.2 - HTTP::request in HTTP_REQUEST_DATA triggers "command is not valid in the current scope" when saving the iRule. I haven't tested, but creating a variable in HTTP_REQUEST and referencing it in the HTTP_REQUEST_DATA event should do the trick:
when HTTP_REQUEST {
...
set req_headers [HTTP::request]
}
when HTTP_REQUEST_DATA {
for {set i 0}{$i < $static::pool_count}{incr i}{
if {$static::clone_debug}{
log local0. "[IP::client_addr]:[TCP::client_port]: Collected [HTTP::payload length] bytes,\
sending [expr {[string length $req_headers] + [HTTP::payload length]}] bytes total\
to $static::clone_pools($i), request: $req_headers[HTTP::payload]"}
HSL::send $hsl($i) "$req_headers[HTTP::payload]\n"
}
}