crossroads

Git mirror of https://crossroads.e-tunity.com/
git clone git://git.finwo.net/app/crossroads
Log | Files | Refs

stickycookie.yo (1222B)


      1 conf(stickycookie - Back end selection with an HTTP cookie)
      2     (The directive tt(stickycookie) em(value)
      3      causes Crossroads to unpack clients' requests, to check for
      4      em(value) in the cookies. When found, the message is routed to the
      5      back end having the appropriate tt(stickycookie) directive.
      6 
      7      E.g., consider the following configuration:
      8     
      9      verb(\
     10 service ... {
     11     ...
     12     backend one {
     13         ...
     14         stickycookie "BalancerID=first";
     15     }
     16     backend two {
     17         ...
     18         stickycookie "BalancerID=second";
     19     }
     20 })
     21 
     22      When clients' messages contain cookies named tt(BalancerID) with
     23      the value tt(first), then such messages are routed to backend
     24      tt(one). When the value is tt(second) then they are routed to the
     25      backend tt(two).
     26 
     27      There are basically to provide such cookies to a browser. First, a
     28      back end can insert such a cookie into the HTTP response. E.g.,
     29      the webserver of back end tt(one) might insert a cookie named
     30      tt(BalancerID), having value tt(first).
     31      Second, Crossroads can insert such cookies using a carefully
     32      crafted directive tt(addclientheader).)
     33     (tt(stickycookie) em(cookievalue))
     34     (There is no default.)
     35