Forum Discussion
JRahm
Feb 13, 2007Admin
This takes a class that has special TCP payload data that is mapped to a specific destination port. TCP is collected and analyzed for that special data, if it exists, findclass will pull out the appropriate port number and set the variable new_port, which you can then use in the LB_SELECTED event to direct to the appropriate pool member. Is this what you're looking for?
class port_map {
"special_data1 port1"
"special_data2 port2"
"special_data3 port3"
...
"special_data1500 port 1500"
}
when CLIENT_ACCEPTED {
TCP::collect XX
}
when CLIENT_DATA {
if { [TCP::payload XX] contains "myData" } {
set new_port [findclass [TCP::payload XX] $::port_map " " ]
}
TCP::release
}
when LB_SELECTED {
pool [LB::server pool] member [LB::server addr] $new_port
}