Forum Discussion
hooleylist
Feb 14, 2011Cirrostratus
Hi John,
Maybe something like this?
when CLIENT_ACCEPTED {
Save the name of the default pool on the virtual server
set default_pool [LB::server pool]
Collect the TCP payload to parse the username
TCP::collect
}
when CLIENT_DATA {
TCP::collect 25
binary scan [TCP::payload] x11a* msrdp
log local0. "Contents after binary scan: $msrdp"
if { [string equal -nocase -length 17 $msrdp "cookie: mstshash="] } {
set msrdp [string range $msrdp 17 end]
set len [string first "\n" $msrdp]
if { $len == -1 } {
TCP::collect
return
}
if { $msrdp contains "@" } {
log local0. "Setting data to: [getfield $msrdp "@" 1]"
set username [getfield $msrdp "@" 1]
} elseif { $msrdp contains "\\" } {
log local0. "Setting data to: [getfield $msrdp "\\" 3]"
set username [getfield $msrdp "\\" 3]
} else {
set username $msrdp
log local0. "Setting data to: $msrdp"
}
set finalusername [string tolower $username]
set finalusername [string trim $finalusername]
set finalusername [string range $finalusername 0 8]
log local0. "User Being Persisted is: |$finalusername|"
persist uie $finalusername 7200
if {$finalusername eq "jmasgalas"}{
node 10.0.0.10
} else {
pool $default_pool
}
}
TCP::release
}
Aaron