For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

nullmodem_27781's avatar
nullmodem_27781
Icon for Nimbostratus rankNimbostratus
Jul 25, 2016

Non-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