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...
Jon_Strabala_46
Nimbostratus
Feb 02, 2010Fetching content from external source, seems to be a bit buggy, at leas in my use case
where I have a pair of load balanced servers that share the same nodes. For some reason
selecting a pool doesn't seem to force a particular port.
Question 1, Why do I have to define virtual servers (it will not work at all if I do not),
from the examples I though I only needed to reference pools ?
Question 2, Why does it only work http://10.0.185.150:8002/prox_evdo/auth.gif?rnd12345,
or why doesn't the right OOB port, 8002, get selected on the fetch from
http://10.0.185.150/prox_evdo/auth.gif?rnd12345?
Based on iRULEs examples ....
SEE: http://devcentral.f5.com/Default.aspx?tabid=63&articleType=ArticleView&articleId=105
SEE: http://devcentral.f5.com/Default.aspx?tabid=53&view=topic&forumid=5&postid=14001
SEE: http://devcentral.f5.com/Wiki/default.aspx/iRules/OpenSSO_authentication.html
I have two virtual servers (that share the same LB nodes) with this same rule attached
A) mdn_track 10.0.185.150:80 nodes 10.0.180.3 and 10.0.180.5
B) mdn_lookup 10.0.185.150:8002 nodes 10.0.180.3 and 10.0.180.5
*) Note, mdn_track is a web server and /prox_evdo/auth.gif returns a 1x1 gif
*) Note, mdn_track always returns "808111222 "
*) Note, on the F5 we have self IPs for 10.0.180.10&11 and 10.0.185.10&11
THIS REQ WORKS (mdn_lookup goes to port 8002, mdn_track goes to port 80)
http://10.0.185.150:8002/prox_evdo/auth.gif?rnd12345
: OOB mdn_lookup host <10.0.185.150:8002> mod-uri LB::server
: OOB mdn_lookup: response STAT <200> lbsvr stat up conlen <10>
: OOB mdn_lookup: STAT <200> VALID payload ... <8081112222 >, retry orig
: new req
: mdn_track host <10.0.185.150:8002> orig-uri LB::server
: mdn_track: response STAT <200> lbsvr stat up conlen <44>
THIS REQ FAILS (mdn_lookup goes to port 80, mdn_track never called) why doesn't "pool mdn_lookup" select the 8002 port
http://10.0.185.150/prox_evdo/auth.gif?rnd12345
: OOB mdn_lookup host <10.0.185.150> mod-uri LB::server
: OOB mdn_lookup: response STAT <404> lbsvr stat up conlen <271>
: OOB mdn_lookup: STAT <404> REJECT payload ... <
Question 1, Why do I have to define virtual servers (it will not work at all if I do not),
from the examples I though I only needed to reference pools ?
Question 2, Why does it only work http://10.0.185.150:8002/prox_evdo/auth.gif?rnd12345,
or why doesn't the right OOB port, 8002, get selected on the fetch from
http://10.0.185.150/prox_evdo/auth.gif?rnd12345?
when CLIENT_ACCEPTED {
set lookup 1
set valid_string "808"
}
when HTTP_REQUEST {
if { [HTTP::version] eq "1.1" } {
if { [HTTP::header is_keepalive] } {
HTTP::header replace "Connection" "Keep-Alive"
}
HTTP::version "1.0"
}
if {$lookup == 1} {
set def_server [LB::server]
set LB_request [HTTP::request]
inject lookup URI in place of original request;
HTTP::uri "/[IP::client_addr]"
the below never seems to update the port only works if initial port is 8002, it fails
to update the port to 8002 if the original request is 80
pool mdn_lookup
set oob_server [LB::server]
log local0. "OOB mdn_lookup host <[HTTP::host]> mod-uri <[HTTP::uri]> LB::server <$oob_server>"
} else {
log local0. "mdn_track host <[HTTP::host]> orig-uri <[HTTP::uri]> LB::server <$def_server>"
pool mdn_track
}
}
when HTTP_RESPONSE {
if {$lookup == 1} {
log local0. "OOB mdn_lookup: response STAT <[HTTP::status]> lbsvr <[LB::server]> stat [LB::status] conlen <[HTTP::header Content-Length]>"
if {[HTTP::header exists Content-Length] && \
([HTTP::header Content-Length] < 1048576)}{
set clength [HTTP::header Content-Length]
} else {
set clength 1048576
}
HTTP::collect $clength
} else {
log local0. "mdn_track: response STAT <[HTTP::status]> lbsvr <[LB::server]> stat [LB::status] conlen <[HTTP::header Content-Length]>"
}
}
when LB_FAILED {
log local0.debug "LB failed for: [LB::server]"
log local0.debug "LB status: [LB::status]"
}
when HTTP_RESPONSE_DATA {
if {[HTTP::payload] contains $valid_string}{
log local0. "OOB mdn_lookup: STAT <[HTTP::status]> VALID payload ... <[HTTP::payload]>, retry orig"
the below always seems to update the port to 80 as expected, evenif the original port was 8002
pool mdn_track
log local0. "new req <$LB_request>"
HTTP::retry $LB_request
} else {
log local0. "OOB mdn_lookup: STAT <[HTTP::status]> REJECT payload ... <[HTTP::payload]>"
reject
}
set lookup 0
}
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
