Forum Discussion
nullmodem_27781
Nimbostratus
Jul 25, 2016Non-blocking (asynchronous) SIDEBAND
Hi,
I am capturing a value from POST, and if found, I fire HTTP GET sideband to external server. It looks, despite I explicitly call HTTP::release, that main connection waits for sideband to return. What I want to achieve is asynchronous sideband that does not delay the main request. Can you please advise if this is possible?
My iRule is below:
when HTTP_REQUEST {
if { ( [string tolower [HTTP::uri]] equals "/tokensubmit" ) and ( [HTTP::method] equals "POST" ) } {
log local0. "Firing up POST irule on [HTTP::uri]"
HTTP::collect [HTTP::header Content-Length]
}
}
when HTTP_REQUEST_DATA {
set token "unknown"
foreach x [split [string tolower [HTTP::payload]] "&"] {
if { $x starts_with "token=" } {
set token [lindex [split $x "="] 1]
}
}
HTTP::release
set conn [connect -timeout 30000 -idle 30 -status conn_status 8.8.8.8:80]
log local0. "Connect returns: <$conn> and conn status: <$conn_status> "
set conn_info [connect info -idle -status $conn]
log local0. "Connect info: <$conn_info>"
set data "GET /?token=$token HTTP/1.0\r\n\r\n"
set send_info [send -timeout 30000 -status send_status $conn $data]
log local0. "Sent <$send_info> bytes and send status: <$send_status>"
close $conn
log local0. "Closed; conn info: <[connect info -status $conn]>"
}
No RepliesBe the first to reply
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
