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 response?
Thanks
Adrian
- adrian_1812
Nimbostratus
anyone know if you can use standard tcl geturl? - JRahm
Admin
I don't think so... I get an undefined procedure on that one when checking syntax. The url can be constructed, however, with HTTP::host and HTTP::uri. - JRahm
Admin
The iRules are event driven, so when a request/response arrives, do this... HTTP::host and HTTP::uri will give you the information from within a request, but I'm not sure what you are looking to do is possible within the context of iRules. - JRahm
Admin
You could build a class up front for each country and put as grand a summarization of those spaces as possible, or you could sub-optimally route the first request from each range, log any new range request, which could kick off an event to an iControl app that can build the class for you for future requests from that range. - adrian_1812
Nimbostratus
the tables for a country would be huge!! - JRahm
Admin
Yes. In fact, if you sent the initial request to server X, you could have it check the country and forward it back in the response, then you could resend the request to the appropriate pool. - adrian_1812
Nimbostratus
Hi - Deb_Allen_18Historic F5 AccountHi Adrian --
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 }
- Jon_Strabala_46
Nimbostratus
I would like to get this example to work, but all my requests go - hoolio
Cirrostratus
Hi Jon,
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