Forum Discussion
APT-Productions
Nimbostratus
Sep 03, 2015how to select a different virtual server's current pool?
We're working up websocket support and sending websocket connection attempts to a specific application pool.
www VIP uses pool www_default (usually). app VIP uses pool app_default (usually).
T...
APT-Productions
Nimbostratus
Sep 11, 2015Well, 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.
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
