Forum Discussion
APT-Productions
Sep 11, 2015Nimbostratus
Well, we ended up going with this solution:
iRule activated on app VIP:
when LB_SELECTED {
set static::app_current_pool [LB::server pool]
}
Every time a pool member is selected for the a connection through the VIP, the global var 'app_current_pool' is set to the pool name.
The final iRule on the web VIP:
when CLIENT_ACCEPTED {
HTTP::enable
}
when HTTP_REQUEST {
if {[HTTP::header value "Upgrade"] equals "websocket"} {
if { ( [class match [HTTP::uri] starts_with WebSocketUris ] ) } {
if { [info exists "static::app_current_pool"] } {
pool $static::app_current_pool
else
pool app_default
}
HTTP::disable
return
}
}
}
Major change here is if the var exists, use it's value. Otherwise, run with default.
This has been tested and works.