1.1 403 Forbidden\r\nServer: HTTP Proxy/1.0\r\nConnection: Close\r\nContent-Length:
use OS_SLB;
use OS_HTTP_REQUEST;
use OS_HTTP_RESPONSE;
sub HTTP_REQUEST {
# Get the Cookie from the request
my $mycookie = OS_HTTP_REQUEST::cookie("ServerID");
#print "\n my cookie is: $mycookie\n";
if (defined $mycookie) {
$serverName = OS_SLB::persist_lookup("passive-persist", "$mycookie");
#print "\n\n\n &&& my server is: $serverName\n";
}
if (defined $serverName ) {
# forward to server based on passive cookie persistence
OS_SLB::persist("passive-persist","$mycookie");
} else {
OS_SLB::forward(10);
}
}
sub HTTP_RESPONSE {
$mySetCookie = OS_HTTP_RESPONSE::header("Set-Cookie");
#print "\n my set cookie is: $mySetCookie\n";
if ( $mySetCookie =~ m/.*ServerID=(\d+).*/ ) {
$cookie = $1;
#print "\n my cookie is: $cookie\n";
OS_SLB::passive_persist("add","$cookie");
}
}
Commenti su questo manuale