Forum Discussion
Sulabh_Srivasta
Mar 21, 2020Cirrus
For testing, I am using this iRule but it is not working :
when RULE_INIT {
set ::active_connections 0
set ::max_connections 2
set ::html_content "over_limit"
}
when CLIENT_ACCEPTED {
set over_limit 0
if {$::active_connections > $::max_connections } {
set over_limit 1
} else {
incr ::active_connections 1
}
}
when HTTP_REQUEST {
if {$over_limit}{
HTTP::respond 200 content $::html_content
HTTP::close
}
}
when CLIENT_CLOSED {
incr ::active_connections -1
}