Forum Discussion
Jonathan_Scholi
Apr 28, 2011Cirrostratus
Preserving ToS over the duration of a download
We have the need to set ToS values for a video application. In order to set ToS values differently for the video and non-video that goes through the application, I created one pool with IP ToS values...
hooleylist
Apr 29, 2011Cirrostratus
Hi Jonathan,
If you don't have a OneConnect profile associated with the virtual server, you should be able to use a rule like this to keep the same pool selected after an HTTP request contains wmv in the path. Make sure to comment out or remove the logging once you're done testing.
when CLIENT_ACCEPTED {
Save the name of the default pool before it is modified in the rule
set default_pool [LB::server pool]
log local0. "[IP::client_addr]:[TCP::client_port]: Default pool: $default_pool"
}
when HTTP_REQUEST {
Check if request is for a wmv file
switch -glob [string tolower [HTTP::path]] {
"*.wmv" {
pool tos-40-pool
log local0. "[IP::client_addr]:[TCP::client_port]: Selected: [LB::server] for wmv request"
if { ![LB::status up] }{
log local0. "[IP::client_addr]:[TCP::client_port]: Pool not up, dropping connection"
drop
}
}
}
default {
log local0. "[IP::client_addr]:[TCP::client_port]: Non-wmv file, detaching"
LB::detach
}
}
}
Debug events only. Comment out or remove once done testing.
when LB_SELECTED {
log local0. "[IP::client_addr]:[TCP::client_port]: Selected: [LB::server]"
}
when SERVER_CONNECTED {
log local0. "[IP::client_addr]:[TCP::client_port]: Connected: [IP::server_addr]:[TCP::server_port]"
}
Aaron
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