Forum Discussion
Deb_Allen_18
Apr 30, 2007Historic F5 Account
Hi Adrian --
The "HTTP::retry" command offers a useful trigger for scenarios like this, where there is a requirement for an out-of-band socket connection to a 3rd host. Something like this might be a good start to what you're after:
when HTTP_REQUEST {
save original request
set req [HTTP::request]
flag as new request needing lookup
set lookup 1
inject lookup URI in place of original request
HTTP::uri "/page.aspx?ip=[IP::client_addr]"
set pool to lookup server pool
pool lookup_server
}
when HTTP_RESPONSE {
if {$lookup == 1 }{
collect first response (from lookup server) only
HTTP::collect
}
}
when HTTP_RESPONSE_DATA {
Get poolname from server response
Response would ideally be in the form of a pool name only.
Otherwise parse or derive the poolname here
set myPool [HTTP::payload]
verify pool exists and has members
if { ![catch [pool $myPool]] }{
HTTP::retry $req
} else {
insert dead/non-existent pool logic here
}
re-set flag so that subsequent response to re-tried
request from real server is not processed as a lookup
set lookup 0
}
HTH
/deb