Forum Discussion

praque_135655's avatar
praque_135655
Icon for Nimbostratus rankNimbostratus
Oct 25, 2013

Invoke another loadbalancer url from current loadbalancer url using irule

Hi All,

 

I have developed the code for the following use case. I have used the HTTP:URI to call the cookiegenerator.html,

 

but i need to call diffrent loadbalacer url(http://xmppt.airservices.eds.com:8080/TestBasicAuth/cookiegenerator.html) to call

 

from the current loadbalancer url( http://xmppwst.airservices.eds.com/OAuthDemo/finalusers.html).

 

Instead of HTTP:uri, what should i use to call cookiegenerator.html and return back to current loadbalacer url(finalusers.html)

 

Also please validate the code and let me know for any correction.

 

when CLIENT_ACCEPTED { log local0. "enter client_accepted" set cookie 1 set gotpath 1 }

 

when HTTP_REQUEST { log local0. "enter http_request: gotpath=$gotpath" if { $gotpath == 1 } { HTTP::uri /OAuthDemo/cookiegenerator.html set gotpath 0 } }

 

when HTTP_RESPONSE { log local0. "http_response: cookie=$cookie; status=[HTTP::status]; sm=[HTTP::cookie exists "SMSESSION"]" if { [HTTP::cookie exists "SMSESSION"] } { set smsession "SMSESSION=[HTTP::cookie value SMSESSION]" }

 

if { [HTTP::status] == 200} { if { $cookie == 1 } { HTTP::header insert "Set-Cookie" "$smsession" set cookie 0 } } }

 

Regards, Praque

 

No RepliesBe the first to reply