Forum Discussion
adrian_1812
Nimbostratus
Apr 30, 2007Fetching content from external source
Howdy All
Is there anyway to fetch content from an external source, to determine what to do with it?
ie go get http://182.168.0.1/page.aspx?ip=1.1.1.1
and then act on the...
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
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